Skip to content
Permalink
Browse files
added log4j and able to stand up geode/kafka/zookeeper
  • Loading branch information
jhuynh1 committed Jan 15, 2020
1 parent 24c80bf commit da1bfb67f536e22c2739944496df0c7512af42ba
Showing 6 changed files with 21 additions and 5 deletions.
@@ -15,10 +15,15 @@ dependencies {

compile 'org.apache.geode:geode-core:1.11.0'
compile(group: 'org.apache.kafka', name: 'connect-api', version: '2.3.1')
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.0'


testCompile(group: 'org.apache.kafka', name: 'kafka_2.12', version: '2.3.1')
testCompile(group: 'org.apache.kafka', name: 'kafka-streams-test-utils', version: '1.1.0')
testCompile(group: 'org.apache.curator', name: 'curator-framework', version: '4.2.0')
testCompile(group: 'org.apache.kafka', name: 'connect-runtime', version: '2.3.1')

testCompile group: 'junit', name: 'junit', version: '4.12'

}
@@ -27,6 +27,7 @@ public Class<? extends Task> taskClass() {

@Override
public List<Map<String, String>> taskConfigs(int maxTasks) {
System.out.println("GKSource: taskConfigs");
List<Map<String, String>> taskConfigs = new ArrayList<>();
Map<String, String> taskProps = new HashMap<>();

@@ -49,7 +49,7 @@ public void start(Map<String, String> props) {
offset = new HashMap<>();
offset.put("OFFSET", 0L);

installOnGeode("localHost", 18888, "someRegion");
installOnGeode("localHost", 10334, "someRegion");
}

@Override
@@ -39,7 +39,7 @@ public static void shutdown() {
}

private ClientCache createGeodeClient() {
return new ClientCacheFactory().addPoolLocator("127.0.0.1", 10334).create();
return new ClientCacheFactory().addPoolLocator("localhost", 10334).create();
}

private static void startZooKeeper() throws IOException, QuorumPeerConfig.ConfigException {
@@ -16,8 +16,10 @@ public static void main(String[] args) throws IOException {
// String statsFile = new File(context.getOutputDir(), "stats.gfs").getAbsolutePath();
// properties.setProperty(ConfigurationPropert/**/ies.STATISTIC_ARCHIVE_FILE, statsFile);
properties.setProperty(ConfigurationProperties.NAME, "locator1");
Locator.startLocatorAndDS(10334, null, properties);
Locator.startLocatorAndDS(10334, new File("/Users/jhuynh/Pivotal/geode-kafka-connector/"), properties);
while (true) {

}
//
// LocatorLauncher locatorLauncher = new LocatorLauncher.Builder()
// .setMemberName("locator1")
@@ -2,6 +2,7 @@

import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.ServerLauncher;
@@ -36,13 +37,20 @@ public static void main(String... args) throws IOException {
.set(ConfigurationProperties.LOCATORS, locatorString)
.set(ConfigurationProperties.NAME,
"server-1")
.set(ConfigurationProperties.LOG_FILE, "/Users/jhuynh/Pivotal/geode-kafka-connector/server1.log")
.set(ConfigurationProperties.LOG_FILE, "/Users/jhuynh/Pivotal/geode-kafka-connector/")
.set(ConfigurationProperties.LOG_LEVEL, "info")
// .set(ConfigurationProperties.STATISTIC_ARCHIVE_FILE, statsFile)
.create();
CacheServer cacheServer = cache.addCacheServer();
cacheServer.setPort(0);
cacheServer.setMaxConnections(Integer.MAX_VALUE);
// cacheServer.setMaxConnections(Integer.MAX_VALUE);
cacheServer.start();

//create the region
cache.createRegionFactory(RegionShortcut.PARTITION).create("someRegion");
System.out.println("starting cacheserver");
while (true) {

}
}
}

0 comments on commit da1bfb6

Please sign in to comment.