View Javadoc

1   /*
2    * Copyright 2010 Ning, Inc.
3    *
4    * Ning licenses this file to you under the Apache License, version 2.0
5    * (the "License"); you may not use this file except in compliance with the
6    * License.  You may obtain a copy of the License at:
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  
17  package com.ning.metrics.goodwill.binder.config;
18  
19  import org.skife.config.Config;
20  import org.skife.config.Default;
21  import org.skife.config.DefaultNull;
22  
23  public interface GoodwillConfig
24  {
25      @Config(value = "goodwill.store.type")
26      @Default("mysql")
27      public String getStoreType();
28  
29      @Config(value = "goodwill.store.csv.file.path")
30      @DefaultNull
31      public String getCSVFilePath();
32  
33      @Config(value = "goodwill.store.db.host")
34      @Default("localhost")
35      public String getStoreDBHost();
36  
37      @Config(value = "goodwill.store.db.port")
38      @Default("3306")
39      public int getStoreDBPort();
40  
41      @Config(value = "goodwill.store.db.name")
42      @Default("goodwill")
43      public String getStoreDBName();
44  
45      @Config(value = "goodwill.store.db.user")
46      @Default("root")
47      public String getStoreDBUsername();
48  
49      @Config(value = "goodwill.store.db.password")
50      @DefaultNull
51      public String getStoreDBPassword();
52  
53      @Config(value = "goodwill.store.db.thrift_table.name")
54      @Default("thrift_types")
55      public String getStoreDBThriftTableName();
56  
57      @Config(value = "goodwill.sink.type")
58      @DefaultNull
59      public String getSinkType();
60  
61      @Config(value = "goodwill.sink.db.table_name_format")
62      @Default("xe_%s")
63      public String getSinkDBTableNameFormat();
64  
65      @Config(value = "goodwill.sink.db.first.host")
66      @Default("localhost")
67      public String getSinkDBFirstHost();
68  
69      @Config(value = "goodwill.sink.db.first.port")
70      @Default("3306")
71      public int getSinkDBFirstPort();
72  
73      /**
74       * First schema to run statements in (where the table is created)
75       *
76       * @return schema where to create the table
77       */
78      @Config(value = "goodwill.sink.db.first.schema")
79      @Default("goodwill_sink")
80      public String getSinkDBFirstSchema();
81  
82      @Config(value = "goodwill.sink.db.first.user")
83      @Default("root")
84      public String getSinkDBFirstUsername();
85  
86      @Config(value = "goodwill.sink.db.first.password")
87      @DefaultNull
88      public String getSinkDBFirstPassword();
89  
90      /**
91       * To create a stage table for instance:
92       * <p/>
93       * CREATE TABLE STAGE_? AS SELECT * FROM ? LIMIT 0;
94       *
95       * @return extra SQL to run in the schema where the table is created
96       */
97      @Config(value = "goodwill.sink.db.first.extra_sql")
98      @DefaultNull
99      public String getSinkFirstExtraSQL();
100 
101     @Config(value = "goodwill.sink.db.second.host")
102     @Default("localhost")
103     public String getSinkDBSecondHost();
104 
105     @Config(value = "goodwill.sink.db.second.port")
106     @Default("3306")
107     public int getSinkDBSecondPort();
108 
109     /**
110      * Optionally, Goodwill can run statements in another schema (database). This can be useful when cross database access
111      * is not supported.
112      *
113      * @return Second schema to run statements in
114      */
115     @Config(value = "goodwill.sink.db.second.schema")
116     @Default("goodwill_sink")
117     public String getSinkDBSecondSchema();
118 
119     @Config(value = "goodwill.sink.db.second.user")
120     @Default("root")
121     public String getSinkDBSecondUsername();
122 
123     @Config(value = "goodwill.sink.db.second.password")
124     @DefaultNull
125     public String getSinkDBSecondPassword();
126 
127     @Config(value = "goodwill.sink.db.second.extra_sql")
128     @DefaultNull
129     public String getSinkSecondExtraSQL();
130 
131     @Config(value = "goodwill.action.url")
132     @DefaultNull
133     public String getActionCoreURL();
134 
135     // Whether the DELETE API is allowed.
136     // In general, you don't want to enable it in production as you won't be able to read data in HDFS associated
137     // to deleted events via the goodwill-access library
138 
139     @Config(value = "goodwill.api.delete")
140     @Default("false")
141     public boolean allowDeleteEvent();
142 }