Skip to content

Instantly share code, notes, and snippets.

@angryTit
Created June 26, 2017 16:04
Show Gist options
  • Save angryTit/ab6951240f66fa4cc6d5312edb7ac8b0 to your computer and use it in GitHub Desktop.
Save angryTit/ab6951240f66fa4cc6d5312edb7ac8b0 to your computer and use it in GitHub Desktop.
public TitanGraph graph() {
BaseConfiguration conf = new BaseConfiguration();
conf.setProperty("storage.batch-loading", true);
conf.setProperty("schema.default", "none");
conf.setProperty("gremlin.graph", "com.thinkaurelius.titan.core.TitanFactory");
conf.setProperty("ids.block-size", 1000000);
conf.setProperty("storage.setup-wait", 60000);
conf.setProperty("storage.buffer-size", 10024);
conf.setProperty("storage.write-time", "1 ms");
conf.setProperty("storage.read-time", "1 ms");
conf.setProperty("storage.backend", "com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager");
conf.setProperty("storage.dynamodb.client.credentials.constructor-args", "");
conf.setProperty("storage.dynamodb.client.endpoint", "https://dynamodb.ap-southeast-1.amazonaws.com");
conf.setProperty("storage.dynamodb.client.signing-region", "ap-southeast-1");
conf.setProperty("storage.dynamodb.client.credentials.class-name", "com.amazonaws.auth.DefaultAWSCredentialsProviderChain");
conf.setProperty("storage.dynamodb.force-consistent-read", true);
//!!Database Prefix
conf.setProperty("storage.dynamodb.prefix", "g_v7");
//max http connections - not recommended to use more than 250 connections in DynamoDB Local
conf.setProperty("storage.dynamodb.client.connection-max", 200);
conf.setProperty("storage.dynamodb.metrics-prefix", "d");
conf.setProperty("storage.dynamodb.enable-parallel-scans", false);
conf.setProperty("storage.dynamodb.max-self-throttled-retries", 60);
conf.setProperty("storage.dynamodb.control-plane-rate", 10);
//turn off sdk retries
conf.setProperty("storage.dynamodb.client.retry-error-max", 0);
//DynamoDB client configuration: thread pool
conf.setProperty("storage.dynamodb.client.executor.core-pool-size", 200);
//Do not need more threads in thread pool than the number of http connections
conf.setProperty("storage.dynamodb.client.executor.max-pool-size", 200);
conf.setProperty("storage.dynamodb.client.executor.keep-alive", 60000);
conf.setProperty("storage.dynamodb.client.executor.max-concurrent-operations", 1);
conf.setProperty("storage.dynamodb.client.executor.max-queue-length", 1024);
conf.setProperty("storage.dynamodb.stores.edgestore.capacity-read", 10_000);
conf.setProperty("storage.dynamodb.stores.edgestore.capacity-write", 10_000);
conf.setProperty("storage.dynamodb.stores.edgestore.read-rate", 10_000);
conf.setProperty("storage.dynamodb.stores.edgestore.write-rate", 10_000);
conf.setProperty("storage.dynamodb.stores.graphindex.capacity-read", 4_000);
conf.setProperty("storage.dynamodb.stores.graphindex.capacity-write", 2_000);
conf.setProperty("storage.dynamodb.stores.graphindex.read-rate", 4_000);
conf.setProperty("storage.dynamodb.stores.graphindex.write-rate", 2_000);
conf.setProperty("storage.dynamodb.stores.systemlog.capacity-read", 50);
conf.setProperty("storage.dynamodb.stores.systemlog.capacity-write", 10);
conf.setProperty("storage.dynamodb.stores.systemlog.read-rate", 50);
conf.setProperty("storage.dynamodb.stores.systemlog.write-rate", 10);
conf.setProperty("storage.dynamodb.stores.titan_ids.capacity-read", 50);
conf.setProperty("storage.dynamodb.stores.titan_ids.capacity-write", 50);
conf.setProperty("storage.dynamodb.stores.titan_ids.read-rate", 50);
conf.setProperty("storage.dynamodb.stores.titan_ids.write-rate", 50);
conf.setProperty("storage.dynamodb.stores.system_properties.capacity-read", 50);
conf.setProperty("storage.dynamodb.stores.system_properties.capacity-write", 10);
conf.setProperty("storage.dynamodb.stores.system_properties.read-rate", 50);
conf.setProperty("storage.dynamodb.stores.system_properties.write-rate", 10);
conf.setProperty("storage.dynamodb.stores.txlog.capacity-read", 50);
conf.setProperty("storage.dynamodb.stores.txlog.capacity-write", 10);
conf.setProperty("storage.dynamodb.stores.txlog.read-rate", 50);
conf.setProperty("storage.dynamodb.stores.txlog.write-rate", 10);
TitanGraph graph = TitanFactory.open(conf);
return graph;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment