File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
java/io/edurt/gcm/example/general Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 5050 <artifactId >gcm-hive</artifactId >
5151 <version >${project.version} </version >
5252 </dependency >
53+ <dependency >
54+ <groupId >io.edurt.gcm</groupId >
55+ <artifactId >gcm-zookeeper</artifactId >
56+ <version >${project.version} </version >
57+ </dependency >
5358 </dependencies >
5459
5560</project >
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed under the Apache License, Version 2.0 (the "License");
3+ * you may not use this file except in compliance with the License.
4+ * You may obtain a copy of the License at
5+ *
6+ * http://www.apache.org/licenses/LICENSE-2.0
7+ *
8+ * Unless required by applicable law or agreed to in writing, software
9+ * distributed under the License is distributed on an "AS IS" BASIS,
10+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ * See the License for the specific language governing permissions and
12+ * limitations under the License.
13+ */
14+ package io .edurt .gcm .example .general ;
15+
16+ import com .google .inject .Guice ;
17+ import com .google .inject .Inject ;
18+ import io .edurt .gcm .zookeeper .ZookeeperModule ;
19+ import io .edurt .gcm .zookeeper .client .ZookeeperClient ;
20+
21+ public class ZookeeperExample
22+ {
23+ @ Inject
24+ private ZookeeperClient zookeeperClient ;
25+
26+ public static void main (String [] args )
27+ {
28+ String classpath = ZookeeperExample .class .getResource ("/general/zookeeper.properties" ).getPath ();
29+ ZookeeperExample instance = Guice .createInjector (new ZookeeperModule (classpath ))
30+ .getInstance (ZookeeperExample .class );
31+ System .out .println (instance .zookeeperClient .getNode ("localhost" ));
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ zookeeper.service =localhost:2181
2+ zookeeper.session-timeout =5000
3+ zookeeper.connection-timeout =5000
4+ zookeeper.retry =3
5+ zookeeper.namespace =default
You can’t perform that action at this time.
0 commit comments