-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from ngageoint/GEOWAVE-234
Geowave 234
- Loading branch information
Showing
20 changed files
with
216 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
geowave-utils/src/main/java/mil/nga/giat/geowave/demo/app/GeoWaveDemoApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package mil.nga.giat.geowave.demo.app; | ||
|
||
import com.google.common.io.Files; | ||
|
||
import org.apache.accumulo.minicluster.MiniAccumuloCluster; | ||
import org.apache.accumulo.minicluster.MiniAccumuloConfig; | ||
import org.apache.log4j.Level; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.io.File; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class GeoWaveDemoApp | ||
{ | ||
|
||
public static void main( | ||
String[] args ) | ||
throws Exception { | ||
Logger.getRootLogger().setLevel( | ||
Level.WARN); | ||
|
||
final boolean interactive = (System.getProperty("interactive") != null) ? Boolean.parseBoolean(System.getProperty("interactive")) : true; | ||
final String instanceName = (System.getProperty("instanceName") != null) ? System.getProperty("instanceName") : "geowave"; | ||
final String password = (System.getProperty("password") != null) ? System.getProperty("password") : "password"; | ||
|
||
File tempDir = Files.createTempDir(); | ||
// @formatter:off | ||
/*if[ACCUMULO_1.5.1] | ||
final MiniAccumuloCluster accumulo = new MiniAccumuloCluster( | ||
new MiniAccumuloConfig( | ||
tempDir, | ||
password).setNumTservers( | ||
2)); | ||
else[ACCUMULO_1.5.1]*/ | ||
final MiniAccumuloCluster accumulo = new MiniAccumuloCluster( | ||
new MiniAccumuloConfig( | ||
tempDir, | ||
password).setNumTservers( | ||
2).setInstanceName( | ||
instanceName).setZooKeeperPort( | ||
2181)); | ||
/*end[ACCUMULO_1.5.1]*/ | ||
// @formatter:on | ||
accumulo.start(); | ||
System.out.println("starting up ..."); | ||
Thread.sleep(3000); | ||
|
||
System.out.println("cluster running with instance name " + accumulo.getInstanceName() + " and zookeepers " + accumulo.getZooKeepers()); | ||
|
||
if (interactive) { | ||
System.out.println("hit Enter to shutdown .."); | ||
System.in.read(); | ||
System.out.println("Shutting down!"); | ||
accumulo.stop(); | ||
} | ||
else { | ||
Runtime.getRuntime().addShutdownHook( | ||
new Thread() { | ||
@Override | ||
public void run() { | ||
try { | ||
accumulo.stop(); | ||
} | ||
catch (Exception e) { | ||
System.out.println("Error shutting down accumulo."); | ||
} | ||
System.out.println("Shutting down!"); | ||
} | ||
}); | ||
|
||
while (true) { | ||
Thread.sleep(TimeUnit.MILLISECONDS.convert( | ||
Long.MAX_VALUE, | ||
TimeUnit.DAYS)); | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
geowave-utils/src/main/java/mil/nga/giat/geowave/demo/app/GeoWaveDemoAppShell.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package mil.nga.giat.geowave.demo.app; | ||
|
||
import org.apache.accumulo.core.util.shell.Shell; | ||
import org.apache.log4j.Level; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.io.IOException; | ||
|
||
public class GeoWaveDemoAppShell | ||
{ | ||
|
||
public static void main( | ||
String[] args ) | ||
throws IOException { | ||
Logger.getRootLogger().setLevel( | ||
Level.WARN); | ||
|
||
final String instanceName = (System.getProperty("instanceName") != null) ? System.getProperty("instanceName") : "geowave"; | ||
final String password = (System.getProperty("password") != null) ? System.getProperty("password") : "password"; | ||
|
||
String[] shellArgs = new String[] { | ||
"-u", | ||
"root", | ||
"-p", | ||
password, | ||
"-z", | ||
instanceName, | ||
"localhost:2181" | ||
}; | ||
Shell.main(shellArgs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
Oops, something went wrong.