root/src/stratcon_datastore.h

Revision c53609142a88c05f910282bfa496351d86b55df4, 3.7 kB (checked in by Philip Maddox <philip.maddox@circonus.com>, 2 years ago)

Stratcon Hash Init Cleanup

Missed a couple of required hash inits in Stratcon... added them.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  * Copyright (c) 2015, Circonus, Inc. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials provided
15  *       with the distribution.
16  *     * Neither the name OmniTI Computer Consulting, Inc. nor the names
17  *       of its contributors may be used to endorse or promote products
18  *       derived from this software without specific prior written
19  *       permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _NOIT_STRATCON_DATASTORE_H
35 #define _NOIT_STRATCON_DATASTORE_H
36
37 #include <mtev_defines.h>
38
39 #include <sys/types.h>
40 #include <sys/socket.h>
41
42 #include <eventer/eventer.h>
43 #include <mtev_hash.h>
44
45 #include "stratcon_realtime_http.h"
46
47 typedef struct {
48   int (*launch_file_ingestion)(const char *file, const char *ip,
49                                const char *cn, const char *store,
50                                const mtev_boolean sweeping);
51   void (*iep_check_preload)();
52   int (*storage_node_lookup)(const char *uuid_str, const char *remote_cn,
53                              int *sid_out, int *storagenode_id_out,
54                              const char **remote_cn_out,
55                              const char **fqdn_out, const char **dsn_out);
56   void (*submit_realtime_lookup)(struct realtime_tracker *rt,
57                                  eventer_t completion);
58   char *(*get_noit_config)(const char *cn);
59   int (*save_config)();
60 } ingestor_api_t;
61
62 API_EXPORT(int) stratcon_datastore_set_ingestor(ingestor_api_t *ni);
63
64 typedef struct {
65   char *remote_str;
66   char *remote_cn;
67   char *fqdn;
68   int storagenode_id;
69   int fd;
70   char *filename;
71 } interim_journal_t;
72
73 typedef enum {
74  DS_OP_INSERT = 1,
75  DS_OP_CHKPT = 2,
76  DS_OP_FIND_COMPLETE = 3
77 } stratcon_datastore_op_t;
78
79 API_EXPORT(void)
80   stratcon_datastore_push(stratcon_datastore_op_t,
81                           struct sockaddr *, const char *, void *, eventer_t);
82
83 API_EXPORT(void)
84   stratcon_datastore_register_onlooker(void (*f)(stratcon_datastore_op_t,
85                                                  struct sockaddr *,
86                                                  const char *, void *));
87
88 API_EXPORT(void)
89   stratcon_datastore_core_init();
90
91 API_EXPORT(void)
92   stratcon_datastore_init();
93 API_EXPORT(void)
94   stratcon_datastore_init_globals(void);
95
96 API_EXPORT(int)
97   stratcon_datastore_saveconfig(void *unused);
98
99 /* Private'ish... called from IEP to populate IEP */
100 API_EXPORT(void)
101   stratcon_datastore_iep_check_preload();
102
103 API_EXPORT(int)
104   stratcon_datastore_get_enabled();
105
106 API_EXPORT(void)
107   stratcon_datastore_set_enabled(int);
108
109 #endif
Note: See TracBrowser for help on using the browser.