forked from hugegraph/hugegraph-sync
fix: format and clean code in dist and example modules (#2441)
This commit is contained in:
parent
d61aaae44f
commit
721111d11a
|
|
@ -28,8 +28,8 @@ graphs: {
|
|||
scriptEngines: {
|
||||
gremlin-groovy: {
|
||||
staticImports: [
|
||||
org.opencypher.gremlin.process.traversal.CustomPredicates.*',
|
||||
org.opencypher.gremlin.traversal.CustomFunctions.*
|
||||
org.opencypher.gremlin.process.traversal.CustomPredicates.*',
|
||||
org.opencypher.gremlin.traversal.CustomFunctions.*
|
||||
],
|
||||
plugins: {
|
||||
org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: {},
|
||||
|
|
@ -70,9 +70,9 @@ scriptEngines: {
|
|||
org.opencypher.gremlin.traversal.CustomPredicate
|
||||
],
|
||||
methodImports: [
|
||||
java.lang.Math#*,
|
||||
org.opencypher.gremlin.traversal.CustomPredicate#*,
|
||||
org.opencypher.gremlin.traversal.CustomFunctions#*
|
||||
java.lang.Math#*,
|
||||
org.opencypher.gremlin.traversal.CustomPredicate#*,
|
||||
org.opencypher.gremlin.traversal.CustomFunctions#*
|
||||
]
|
||||
},
|
||||
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {
|
||||
|
|
@ -82,29 +82,29 @@ scriptEngines: {
|
|||
}
|
||||
}
|
||||
serializers:
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
metrics: {
|
||||
consoleReporter: {enabled: false, interval: 180000},
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
<!-- Normal server log config -->
|
||||
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1day or 50MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="50MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
|
||||
<DefaultRolloverStrategy max="5">
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
<IfFileName glob="*/*.log"/>
|
||||
<!-- Limit log amount & size -->
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="2GB" />
|
||||
<IfAccumulatedFileCount exceeds="100" />
|
||||
<IfAccumulatedFileSize exceeds="2GB"/>
|
||||
<IfAccumulatedFileCount exceeds="100"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
@ -54,15 +54,15 @@
|
|||
|
||||
<!-- Separate & compress audit log, buffer size is 512KB -->
|
||||
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<!-- Use simple format for audit log to speed up -->
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1hour or 500MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="500MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
|
||||
<DefaultRolloverStrategy max="2">
|
||||
|
|
@ -70,8 +70,8 @@
|
|||
<IfFileName glob="*/*.gz"/>
|
||||
<IfLastModified age="60d"/>
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="5GB" />
|
||||
<IfAccumulatedFileCount exceeds="500" />
|
||||
<IfAccumulatedFileSize exceeds="5GB"/>
|
||||
<IfAccumulatedFileCount exceeds="500"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
<!-- Trigger after exceeding 1day or 50MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="50MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
|
||||
<DefaultRolloverStrategy max="5">
|
||||
|
|
@ -94,8 +94,8 @@
|
|||
<IfFileName glob="*/*.log"/>
|
||||
<!-- Limit log amount & size -->
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="2GB" />
|
||||
<IfAccumulatedFileCount exceeds="100" />
|
||||
<IfAccumulatedFileSize exceeds="2GB"/>
|
||||
<IfAccumulatedFileCount exceeds="100"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ serializer: {
|
|||
# The duplication of HugeGraphIoRegistry is meant to fix a bug in the
|
||||
# 'org.apache.tinkerpop.gremlin.driver.Settings:from(Configuration)' method.
|
||||
ioRegistries: [
|
||||
org.apache.hugegraph.io.HugeGraphIoRegistry,
|
||||
org.apache.hugegraph.io.HugeGraphIoRegistry
|
||||
org.apache.hugegraph.io.HugeGraphIoRegistry,
|
||||
org.apache.hugegraph.io.HugeGraphIoRegistry
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,29 +74,29 @@ scriptEngines: {
|
|||
}
|
||||
}
|
||||
serializers:
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
metrics: {
|
||||
consoleReporter: {enabled: false, interval: 180000},
|
||||
|
|
|
|||
|
|
@ -74,29 +74,29 @@ scriptEngines: {
|
|||
}
|
||||
}
|
||||
serializers:
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
metrics: {
|
||||
consoleReporter: {enabled: false, interval: 180000},
|
||||
|
|
|
|||
|
|
@ -74,29 +74,29 @@ scriptEngines: {
|
|||
}
|
||||
}
|
||||
serializers:
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
|
||||
config: {
|
||||
serializeResultToString: false,
|
||||
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
|
||||
}
|
||||
}
|
||||
metrics: {
|
||||
consoleReporter: {enabled: false, interval: 180000},
|
||||
|
|
|
|||
|
|
@ -15,24 +15,24 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>${env.MAVEN_REPO_USERNAME}</username>
|
||||
<password>${env.MAVEN_REPO_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<gpg.executable>gpg</gpg.executable>
|
||||
<gpg.keyname>${env.GPG_KEY_ID}</gpg.keyname>
|
||||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<servers>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>${env.MAVEN_REPO_USERNAME}</username>
|
||||
<password>${env.MAVEN_REPO_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<gpg.executable>gpg</gpg.executable>
|
||||
<gpg.keyname>${env.GPG_KEY_ID}</gpg.keyname>
|
||||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
|
|
|
|||
|
|
@ -23,14 +23,13 @@ import java.util.TreeSet;
|
|||
|
||||
import org.apache.commons.configuration.ConfigurationException;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.hugegraph.dist.RegisterUtil;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.config.HugeConfig;
|
||||
import org.apache.hugegraph.config.OptionSpace;
|
||||
import org.apache.hugegraph.config.TypedOption;
|
||||
import org.apache.hugegraph.dist.RegisterUtil;
|
||||
import org.apache.hugegraph.util.E;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class ConfDumper {
|
||||
|
||||
|
|
@ -39,7 +38,7 @@ public class ConfDumper {
|
|||
private static final Logger LOG = Log.logger(ConfDumper.class);
|
||||
|
||||
public static void main(String[] args)
|
||||
throws ConfigurationException, IOException {
|
||||
throws ConfigurationException, IOException {
|
||||
E.checkArgument(args.length == 1,
|
||||
"ConfDumper need a config file.");
|
||||
|
||||
|
|
|
|||
|
|
@ -117,9 +117,10 @@ public class InitStore {
|
|||
}
|
||||
|
||||
private static void initBackend(final HugeGraph graph)
|
||||
throws InterruptedException {
|
||||
throws InterruptedException {
|
||||
int retries = RETRIES;
|
||||
retry: do {
|
||||
retry:
|
||||
do {
|
||||
try {
|
||||
graph.initBackend();
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class HugeGraphServer {
|
|||
}
|
||||
|
||||
public HugeGraphServer(String gremlinServerConf, String restServerConf)
|
||||
throws Exception {
|
||||
throws Exception {
|
||||
// Only switch on security manager after HugeGremlinServer started
|
||||
SecurityManager securityManager = System.getSecurityManager();
|
||||
System.setSecurityManager(null);
|
||||
|
|
|
|||
|
|
@ -17,16 +17,15 @@
|
|||
|
||||
package org.apache.hugegraph.dist;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.server.GremlinServer;
|
||||
import org.apache.tinkerpop.gremlin.server.Settings;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeException;
|
||||
import org.apache.hugegraph.auth.ContextGremlinServer;
|
||||
import org.apache.hugegraph.event.EventHub;
|
||||
import org.apache.hugegraph.util.ConfigUtil;
|
||||
import org.apache.hugegraph.util.E;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.server.GremlinServer;
|
||||
import org.apache.tinkerpop.gremlin.server.Settings;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class HugeGremlinServer {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,10 @@
|
|||
|
||||
package org.apache.hugegraph.dist;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.event.EventHub;
|
||||
import org.apache.hugegraph.server.RestServer;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class HugeRestServer {
|
||||
|
||||
|
|
|
|||
|
|
@ -105,10 +105,12 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.cassandra.CassandraOptions");
|
||||
// Register serializer
|
||||
SerializerFactory.register("cassandra",
|
||||
"org.apache.hugegraph.backend.store.cassandra.CassandraSerializer");
|
||||
"org.apache.hugegraph.backend.store.cassandra" +
|
||||
".CassandraSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("cassandra",
|
||||
"org.apache.hugegraph.backend.store.cassandra.CassandraStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.cassandra" +
|
||||
".CassandraStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerScyllaDB() {
|
||||
|
|
@ -117,10 +119,12 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.cassandra.CassandraOptions");
|
||||
// Register serializer
|
||||
SerializerFactory.register("scylladb",
|
||||
"org.apache.hugegraph.backend.store.cassandra.CassandraSerializer");
|
||||
"org.apache.hugegraph.backend.store.cassandra" +
|
||||
".CassandraSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("scylladb",
|
||||
"org.apache.hugegraph.backend.store.scylladb.ScyllaDBStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.scylladb" +
|
||||
".ScyllaDBStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerHBase() {
|
||||
|
|
@ -132,7 +136,8 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.hbase.HbaseSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("hbase",
|
||||
"org.apache.hugegraph.backend.store.hbase.HbaseStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.hbase" +
|
||||
".HbaseStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerRocksDB() {
|
||||
|
|
@ -141,9 +146,11 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.rocksdb.RocksDBOptions");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("rocksdb",
|
||||
"org.apache.hugegraph.backend.store.rocksdb.RocksDBStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.rocksdb" +
|
||||
".RocksDBStoreProvider");
|
||||
BackendProviderFactory.register("rocksdbsst",
|
||||
"org.apache.hugegraph.backend.store.rocksdbsst.RocksDBSstStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.rocksdbsst" +
|
||||
".RocksDBSstStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerMysql() {
|
||||
|
|
@ -155,7 +162,8 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.mysql.MysqlSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("mysql",
|
||||
"org.apache.hugegraph.backend.store.mysql.MysqlStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.mysql" +
|
||||
".MysqlStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerPalo() {
|
||||
|
|
@ -164,22 +172,25 @@ public class RegisterUtil {
|
|||
"org.apache.hugegraph.backend.store.palo.PaloOptions");
|
||||
// Register serializer
|
||||
SerializerFactory.register("palo",
|
||||
"org.apache.hugegraph.backend.store.palo.PaloSerializer");
|
||||
"org.apache.hugegraph.backend.store.palo.PaloSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("palo",
|
||||
"org.apache.hugegraph.backend.store.palo.PaloStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.palo" +
|
||||
".PaloStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerPostgresql() {
|
||||
// Register config
|
||||
OptionSpace.register("postgresql",
|
||||
"org.apache.hugegraph.backend.store.postgresql.PostgresqlOptions");
|
||||
"org.apache.hugegraph.backend.store.postgresql.PostgresqlOptions");
|
||||
// Register serializer
|
||||
SerializerFactory.register("postgresql",
|
||||
"org.apache.hugegraph.backend.store.postgresql.PostgresqlSerializer");
|
||||
"org.apache.hugegraph.backend.store.postgresql" +
|
||||
".PostgresqlSerializer");
|
||||
// Register backend
|
||||
BackendProviderFactory.register("postgresql",
|
||||
"org.apache.hugegraph.backend.store.postgresql.PostgresqlStoreProvider");
|
||||
"org.apache.hugegraph.backend.store.postgresql" +
|
||||
".PostgresqlStoreProvider");
|
||||
}
|
||||
|
||||
public static void registerServer() {
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
<!-- Normal server log config -->
|
||||
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1day or 50MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="50MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
|
||||
<DefaultRolloverStrategy max="5">
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
<IfFileName glob="*/*.log"/>
|
||||
<!-- Limit log amount & size -->
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="2GB" />
|
||||
<IfAccumulatedFileCount exceeds="100" />
|
||||
<IfAccumulatedFileSize exceeds="2GB"/>
|
||||
<IfAccumulatedFileCount exceeds="100"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
@ -54,15 +54,15 @@
|
|||
|
||||
<!-- Separate & compress audit log, buffer size is 512KB -->
|
||||
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<!-- Use simple format for audit log to speed up -->
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1hour or 500MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="500MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
|
||||
<DefaultRolloverStrategy max="2">
|
||||
|
|
@ -70,8 +70,8 @@
|
|||
<IfFileName glob="*/*.gz"/>
|
||||
<IfLastModified age="60d"/>
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="5GB" />
|
||||
<IfAccumulatedFileCount exceeds="500" />
|
||||
<IfAccumulatedFileSize exceeds="5GB"/>
|
||||
<IfAccumulatedFileCount exceeds="500"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
<!-- Trigger after exceeding 1day or 50MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="50MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
|
||||
<DefaultRolloverStrategy max="5">
|
||||
|
|
@ -94,8 +94,8 @@
|
|||
<IfFileName glob="*/*.log"/>
|
||||
<!-- Limit log amount & size -->
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="2GB" />
|
||||
<IfAccumulatedFileCount exceeds="100" />
|
||||
<IfAccumulatedFileSize exceeds="2GB"/>
|
||||
<IfAccumulatedFileCount exceeds="100"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
|
|||
|
|
@ -21,14 +21,6 @@ import java.util.Arrays;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.P;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
|
||||
import org.apache.tinkerpop.gremlin.structure.Edge;
|
||||
import org.apache.tinkerpop.gremlin.structure.Graph;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.backend.BackendException;
|
||||
|
|
@ -45,6 +37,13 @@ import org.apache.hugegraph.type.HugeType;
|
|||
import org.apache.hugegraph.type.define.Directions;
|
||||
import org.apache.hugegraph.type.define.HugeKeys;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.P;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
|
||||
import org.apache.tinkerpop.gremlin.structure.Edge;
|
||||
import org.apache.tinkerpop.gremlin.structure.Graph;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class Example1 {
|
||||
|
||||
|
|
@ -79,9 +78,9 @@ public class Example1 {
|
|||
graph.tx().commit();
|
||||
|
||||
// New tx
|
||||
GraphTransaction tx = Whitebox.invoke(graph.getClass(),
|
||||
"openGraphTransaction",
|
||||
graph);
|
||||
GraphTransaction tx = Whitebox.invoke(graph.getClass(),
|
||||
"openGraphTransaction",
|
||||
graph);
|
||||
|
||||
tx.addVertex(T.label, "book", "name", "java-21");
|
||||
tx.addVertex(T.label, "book", "name", "java-22");
|
||||
|
|
@ -214,13 +213,13 @@ public class Example1 {
|
|||
graph.tx().commit();
|
||||
|
||||
// must commit manually with new backend tx (independent of tinkerpop)
|
||||
GraphTransaction tx = Whitebox.invoke(graph.getClass(),
|
||||
"openGraphTransaction",
|
||||
graph);
|
||||
GraphTransaction tx = Whitebox.invoke(graph.getClass(),
|
||||
"openGraphTransaction",
|
||||
graph);
|
||||
|
||||
LOG.info("=============== addVertex ================");
|
||||
Vertex james = tx.addVertex(T.label, "author", "id", 1,
|
||||
"name", "James Gosling", "age", 62,
|
||||
"name", "James Gosling", "age", 62,
|
||||
"lived", "San Francisco Bay Area");
|
||||
|
||||
Vertex java = tx.addVertex(T.label, "language", "name", "java",
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ package org.apache.hugegraph.example;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.P;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.Path;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
|
||||
|
|
@ -29,11 +33,6 @@ import org.apache.tinkerpop.gremlin.structure.T;
|
|||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
|
||||
public class Example2 {
|
||||
|
||||
private static final Logger LOG = Log.logger(Example2.class);
|
||||
|
|
@ -93,7 +92,7 @@ public class Example2 {
|
|||
|
||||
String person = graph.schema().getVertexLabel("person").id().asString();
|
||||
String software = graph.schema().getVertexLabel("software").id()
|
||||
.asString();
|
||||
.asString();
|
||||
String markoId = String.format("%s:%s", person, "marko");
|
||||
String joshId = String.format("%s:%s", person, "josh");
|
||||
String lopId = String.format("%s:%s", software, "lop");
|
||||
|
|
@ -122,30 +121,30 @@ public class Example2 {
|
|||
assert paths.get(0).get(1).equals("lop");
|
||||
|
||||
LOG.info(">>>> query with out() optimize: {}",
|
||||
graph.traversal().V(markoId)
|
||||
.out()
|
||||
.out()
|
||||
.values("name").toList());
|
||||
graph.traversal().V(markoId)
|
||||
.out()
|
||||
.out()
|
||||
.values("name").toList());
|
||||
|
||||
LOG.info(">>>> query with out() optimize and path(): {}",
|
||||
graph.traversal().V()
|
||||
.out("knows")
|
||||
.out("created")
|
||||
.values("name")
|
||||
.path()
|
||||
.toList());
|
||||
graph.traversal().V()
|
||||
.out("knows")
|
||||
.out("created")
|
||||
.values("name")
|
||||
.path()
|
||||
.toList());
|
||||
}
|
||||
|
||||
public static List<Path> shortestPath(final HugeGraph graph,
|
||||
Object from, Object to,
|
||||
int maxDepth) {
|
||||
GraphTraversal<Vertex, Path> t = graph.traversal()
|
||||
.V(from)
|
||||
.repeat(__.out().simplePath())
|
||||
.until(__.hasId(to).or().loops().is(P.gt(maxDepth)))
|
||||
.hasId(to)
|
||||
.path().by("name")
|
||||
.limit(1);
|
||||
.V(from)
|
||||
.repeat(__.out().simplePath())
|
||||
.until(__.hasId(to).or().loops().is(P.gt(maxDepth)))
|
||||
.hasId(to)
|
||||
.path().by("name")
|
||||
.limit(1);
|
||||
return t.toList();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@
|
|||
|
||||
package org.apache.hugegraph.example;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class Example3 {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import org.apache.hugegraph.util.Log;
|
|||
import org.slf4j.Logger;
|
||||
|
||||
public class ExampleUtil {
|
||||
|
||||
private static final Logger LOG = Log.logger(ExampleUtil.class);
|
||||
|
||||
private static boolean registered = false;
|
||||
|
|
@ -65,13 +66,13 @@ public class ExampleUtil {
|
|||
String conf = "hugegraph.properties";
|
||||
try {
|
||||
String path = ExampleUtil.class.getClassLoader()
|
||||
.getResource(conf).getPath();
|
||||
.getResource(conf).getPath();
|
||||
File file = new File(path);
|
||||
if (file.exists() && file.isFile()) {
|
||||
conf = path;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
LOG.warn("loadGraph warn {} ",ignored);
|
||||
LOG.warn("loadGraph warn {} ", ignored);
|
||||
}
|
||||
|
||||
HugeGraph graph = HugeFactory.open(conf);
|
||||
|
|
|
|||
|
|
@ -19,17 +19,16 @@ package org.apache.hugegraph.example;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.perf.PerfUtil;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
|
||||
import org.apache.tinkerpop.gremlin.structure.Edge;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.perf.PerfUtil;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
|
||||
public class GraphOfTheMoviesExample {
|
||||
|
||||
private static final Logger LOG = Log.logger(GraphOfTheMoviesExample.class);
|
||||
|
|
@ -43,7 +42,7 @@ public class GraphOfTheMoviesExample {
|
|||
GraphOfTheMoviesExample.load(graph);
|
||||
long endTime = System.currentTimeMillis();
|
||||
LOG.info(">>>> adding all vertices cost time(s): {}",
|
||||
(endTime - startTime) / 1000.0);
|
||||
(endTime - startTime) / 1000.0);
|
||||
|
||||
GraphOfTheMoviesExample.query(graph);
|
||||
|
||||
|
|
@ -107,12 +106,12 @@ public class GraphOfTheMoviesExample {
|
|||
.range().create();
|
||||
|
||||
Vertex theMatrix = graph.addVertex(T.label, "movie", "title",
|
||||
"The Matrix", "released", 1999);
|
||||
"The Matrix", "released", 1999);
|
||||
Vertex keanu = graph.addVertex(T.label, "person", "name", "keanu Reeves", "born", 1964);
|
||||
Vertex carrie = graph.addVertex(T.label, "person", "name",
|
||||
"carrie-anne Moss", "born", 1967);
|
||||
Vertex laurence = graph.addVertex(T.label, "person", "name",
|
||||
"laurence Fishburne", "born", 1961);
|
||||
Vertex carrie = graph.addVertex(T.label, "person", "name",
|
||||
"carrie-anne Moss", "born", 1967);
|
||||
Vertex laurence = graph.addVertex(T.label, "person", "name",
|
||||
"laurence Fishburne", "born", 1961);
|
||||
Vertex hugo = graph.addVertex(T.label, "person", "name", "hugo Weaving", "born", 1960);
|
||||
Vertex lillyW = graph.addVertex(T.label, "person", "name", "Lilly Wachowski", "born", 1967);
|
||||
Vertex lanaW = graph.addVertex(T.label, "person", "name", "Lana Wachowski", "born", 1965);
|
||||
|
|
@ -130,7 +129,7 @@ public class GraphOfTheMoviesExample {
|
|||
emil.addEdge("ACTED_IN", theMatrix, "roles", "emil");
|
||||
|
||||
Vertex theMatrixReloaded = graph.addVertex(T.label, "movie", "title",
|
||||
"The Matrix Reloaded", "released", 2003);
|
||||
"The Matrix Reloaded", "released", 2003);
|
||||
|
||||
keanu.addEdge("ACTED_IN", theMatrixReloaded, "roles", "Neo");
|
||||
carrie.addEdge("ACTED_IN", theMatrixReloaded, "roles", "Trinity");
|
||||
|
|
@ -141,7 +140,7 @@ public class GraphOfTheMoviesExample {
|
|||
joelS.addEdge("PRODUCED", theMatrixReloaded, "score", 10);
|
||||
|
||||
Vertex theMatrixRevolutions = graph.addVertex(T.label, "movie", "title",
|
||||
"The Matrix Revolutions", "released", 2003);
|
||||
"The Matrix Revolutions", "released", 2003);
|
||||
|
||||
keanu.addEdge("ACTED_IN", theMatrixRevolutions, "roles", "Neo");
|
||||
carrie.addEdge("ACTED_IN", theMatrixRevolutions, "roles", "Trinity");
|
||||
|
|
@ -152,10 +151,10 @@ public class GraphOfTheMoviesExample {
|
|||
joelS.addEdge("PRODUCED", theMatrixRevolutions, "score", 10);
|
||||
|
||||
Vertex theDevilsadvocate = graph.addVertex(T.label, "movie", "title",
|
||||
"The Devil's advocate", "released", 1997);
|
||||
"The Devil's advocate", "released", 1997);
|
||||
|
||||
Vertex charlize = graph.addVertex(T.label, "person", "name",
|
||||
"charlize Theron", "born", 1975);
|
||||
"charlize Theron", "born", 1975);
|
||||
Vertex al = graph.addVertex(T.label, "person", "name", "al Pacino", "born", 1940);
|
||||
Vertex taylor = graph.addVertex(T.label, "person", "name", "taylor Hackford", "born", 1944);
|
||||
|
||||
|
|
@ -165,21 +164,21 @@ public class GraphOfTheMoviesExample {
|
|||
taylor.addEdge("DIRECTED", theDevilsadvocate, "score", 10);
|
||||
|
||||
Vertex aFewGoodMen = graph.addVertex(T.label, "movie", "title",
|
||||
"a Few Good Men", "released", 1992);
|
||||
"a Few Good Men", "released", 1992);
|
||||
|
||||
Vertex tomC = graph.addVertex(T.label, "person", "name", "Tom Cruise", "born", 1962);
|
||||
Vertex jackN = graph.addVertex(T.label, "person", "name", "Jack Nicholson", "born", 1937);
|
||||
Vertex demiM = graph.addVertex(T.label, "person", "name", "Demi Moore", "born", 1962);
|
||||
Vertex kevinB = graph.addVertex(T.label, "person", "name", "Kevin Bacon", "born", 1958);
|
||||
Vertex kieferS = graph.addVertex(T.label, "person", "name",
|
||||
"Kiefer Sutherland", "born", 1966);
|
||||
"Kiefer Sutherland", "born", 1966);
|
||||
Vertex noahW = graph.addVertex(T.label, "person", "name", "Noah Wyle", "born", 1971);
|
||||
Vertex cubaG = graph.addVertex(T.label, "person", "name", "Cuba Gooding Jr.", "born", 1968);
|
||||
Vertex kevinP = graph.addVertex(T.label, "person", "name", "Kevin Pollak", "born", 1957);
|
||||
Vertex jtw = graph.addVertex(T.label, "person", "name", "J.T. Walsh", "born", 1943);
|
||||
Vertex jamesM = graph.addVertex(T.label, "person", "name", "James Marshall", "born", 1967);
|
||||
Vertex christopherG = graph.addVertex(T.label, "person", "name",
|
||||
"Christopher Guest", "born", 1948);
|
||||
"Christopher Guest", "born", 1948);
|
||||
Vertex robR = graph.addVertex(T.label, "person", "name", "Rob Reiner", "born", 1947);
|
||||
Vertex aaronS = graph.addVertex(T.label, "person", "name", "aaron Sorkin", "born", 1961);
|
||||
|
||||
|
|
@ -203,7 +202,7 @@ public class GraphOfTheMoviesExample {
|
|||
Vertex kellyM = graph.addVertex(T.label, "person", "name", "Kelly McGillis", "born", 1957);
|
||||
Vertex valK = graph.addVertex(T.label, "person", "name", "Val Kilmer", "born", 1959);
|
||||
Vertex anthonyE = graph.addVertex(T.label, "person", "name",
|
||||
"anthony Edwards", "born", 1962);
|
||||
"anthony Edwards", "born", 1962);
|
||||
Vertex tomS = graph.addVertex(T.label, "person", "name", "Tom Skerritt", "born", 1933);
|
||||
Vertex megR = graph.addVertex(T.label, "person", "name", "Meg Ryan", "born", 1961);
|
||||
Vertex tonyS = graph.addVertex(T.label, "person", "name", "Tony Scott", "born", 1944);
|
||||
|
|
@ -219,7 +218,7 @@ public class GraphOfTheMoviesExample {
|
|||
jimC.addEdge("WROTE", topGun, "score", 10);
|
||||
|
||||
Vertex jerryMaguire = graph.addVertex(T.label, "movie", "title",
|
||||
"Jerry Maguire", "released", 2000);
|
||||
"Jerry Maguire", "released", 2000);
|
||||
|
||||
Vertex reneeZ = graph.addVertex(T.label, "person", "name", "Renee Zellweger", "born", 1969);
|
||||
Vertex kellyP = graph.addVertex(T.label, "person", "name", "Kelly Preston", "born", 1962);
|
||||
|
|
@ -228,7 +227,7 @@ public class GraphOfTheMoviesExample {
|
|||
Vertex bonnieH = graph.addVertex(T.label, "person", "name", "Bonnie Hunt", "born", 1970);
|
||||
Vertex reginaK = graph.addVertex(T.label, "person", "name", "Regina King", "born", 1961);
|
||||
Vertex jonathanL = graph.addVertex(T.label, "person", "name",
|
||||
"Jonathan Lipnicki", "born", 1996);
|
||||
"Jonathan Lipnicki", "born", 1996);
|
||||
Vertex cameronC = graph.addVertex(T.label, "person", "name", "Cameron Crowe", "born", 1957);
|
||||
|
||||
tomC.addEdge("ACTED_IN", jerryMaguire, "roles", "Jerry Maguire");
|
||||
|
|
@ -245,14 +244,14 @@ public class GraphOfTheMoviesExample {
|
|||
cameronC.addEdge("WROTE", jerryMaguire, "score", 10);
|
||||
|
||||
Vertex standByMe = graph.addVertex(T.label, "movie", "title",
|
||||
"Stand By Me", "released", 1986);
|
||||
"Stand By Me", "released", 1986);
|
||||
|
||||
Vertex riverP = graph.addVertex(T.label, "person", "name", "River Phoenix", "born", 1970);
|
||||
Vertex coreyF = graph.addVertex(T.label, "person", "name", "Corey Feldman", "born", 1971);
|
||||
Vertex wilW = graph.addVertex(T.label, "person", "name", "Wil Wheaton", "born", 1972);
|
||||
Vertex johnC = graph.addVertex(T.label, "person", "name", "John Cusack", "born", 1966);
|
||||
Vertex marshallB = graph.addVertex(T.label, "person", "name",
|
||||
"Marshall Bell", "born", 1942);
|
||||
"Marshall Bell", "born", 1942);
|
||||
|
||||
wilW.addEdge("ACTED_IN", standByMe, "roles", "Gordie Lachance");
|
||||
riverP.addEdge("ACTED_IN", standByMe, "roles", "Chris Chambers");
|
||||
|
|
@ -264,7 +263,7 @@ public class GraphOfTheMoviesExample {
|
|||
robR.addEdge("DIRECTED", standByMe, "score", 10);
|
||||
|
||||
Vertex asGoodasItGets = graph.addVertex(T.label, "movie", "title",
|
||||
"as Good as It Gets", "released", 1997);
|
||||
"as Good as It Gets", "released", 1997);
|
||||
|
||||
Vertex helenH = graph.addVertex(T.label, "person", "name", "Helen Hunt", "born", 1963);
|
||||
Vertex gregK = graph.addVertex(T.label, "person", "name", "Greg Kinnear", "born", 1963);
|
||||
|
|
@ -277,10 +276,10 @@ public class GraphOfTheMoviesExample {
|
|||
jamesB.addEdge("DIRECTED", asGoodasItGets, "score", 10);
|
||||
|
||||
Vertex whatDreamsMayCome = graph.addVertex(T.label, "movie", "title",
|
||||
"What Dreams May Come", "released", 1998);
|
||||
"What Dreams May Come", "released", 1998);
|
||||
|
||||
Vertex annabellaS = graph.addVertex(T.label, "person", "name",
|
||||
"annabella Sciorra", "born", 1960);
|
||||
"annabella Sciorra", "born", 1960);
|
||||
Vertex maxS = graph.addVertex(T.label, "person", "name", "Max von Sydow", "born", 1929);
|
||||
Vertex wernerH = graph.addVertex(T.label, "person", "name", "Werner Herzog", "born", 1942);
|
||||
Vertex robin = graph.addVertex(T.label, "person", "name", "robin Williams", "born", 1951);
|
||||
|
|
@ -294,7 +293,7 @@ public class GraphOfTheMoviesExample {
|
|||
vincentW.addEdge("DIRECTED", whatDreamsMayCome, "score", 10);
|
||||
|
||||
Vertex snowFallingonCedars = graph.addVertex(T.label, "movie", "title",
|
||||
"Snow Falling on Cedars", "released", 1999);
|
||||
"Snow Falling on Cedars", "released", 1999);
|
||||
|
||||
Vertex ethanH = graph.addVertex(T.label, "person", "name", "Ethan Hawke", "born", 1970);
|
||||
Vertex rickY = graph.addVertex(T.label, "person", "name", "Rick Yune", "born", 1971);
|
||||
|
|
@ -308,7 +307,7 @@ public class GraphOfTheMoviesExample {
|
|||
scottH.addEdge("DIRECTED", snowFallingonCedars, "score", 10);
|
||||
|
||||
Vertex youveGotMail = graph.addVertex(T.label, "movie", "title",
|
||||
"You've Got Mail", "released", 1998);
|
||||
"You've Got Mail", "released", 1998);
|
||||
|
||||
Vertex parkerP = graph.addVertex(T.label, "person", "name", "Parker Posey", "born", 1968);
|
||||
Vertex daveC = graph.addVertex(T.label, "person", "name", "Dave Chappelle", "born", 1973);
|
||||
|
|
@ -325,7 +324,7 @@ public class GraphOfTheMoviesExample {
|
|||
noraE.addEdge("DIRECTED", youveGotMail, "score", 10);
|
||||
|
||||
Vertex sleeplessInSeattle = graph.addVertex(T.label, "movie", "title",
|
||||
"Sleepless in Seattle", "released", 1993);
|
||||
"Sleepless in Seattle", "released", 1993);
|
||||
|
||||
Vertex ritaW = graph.addVertex(T.label, "person", "name", "Rita Wilson", "born", 1956);
|
||||
Vertex billPull = graph.addVertex(T.label, "person", "name", "Bill Pullman", "born", 1953);
|
||||
|
|
@ -341,20 +340,20 @@ public class GraphOfTheMoviesExample {
|
|||
noraE.addEdge("DIRECTED", sleeplessInSeattle, "score", 10);
|
||||
|
||||
Vertex joeVersustheVolcano = graph.addVertex(T.label, "movie", "title",
|
||||
"Joe Versus the Volcano", "released", 1990);
|
||||
"Joe Versus the Volcano", "released", 1990);
|
||||
|
||||
Vertex johnS = graph.addVertex(T.label, "person", "name",
|
||||
"John Patrick Stanley", "born", 1950);
|
||||
"John Patrick Stanley", "born", 1950);
|
||||
Vertex nathan = graph.addVertex(T.label, "person", "name", "nathan Lane", "born", 1956);
|
||||
|
||||
tomH.addEdge("ACTED_IN", joeVersustheVolcano, "roles", "Joe Banks");
|
||||
megR.addEdge("ACTED_IN", joeVersustheVolcano, "roles",
|
||||
"DeDe, angelica Graynamore, Patricia Graynamore");
|
||||
megR.addEdge("ACTED_IN", joeVersustheVolcano, "roles",
|
||||
"DeDe, angelica Graynamore, Patricia Graynamore");
|
||||
nathan.addEdge("ACTED_IN", joeVersustheVolcano, "roles", "Baw");
|
||||
johnS.addEdge("DIRECTED", joeVersustheVolcano, "score", 10);
|
||||
|
||||
Vertex whenHarryMetSally = graph.addVertex(T.label, "movie", "title",
|
||||
"When Harry Met Sally", "released", 1998);
|
||||
"When Harry Met Sally", "released", 1998);
|
||||
|
||||
Vertex billyC = graph.addVertex(T.label, "person", "name", "Billy Crystal", "born", 1948);
|
||||
Vertex carrieF = graph.addVertex(T.label, "person", "name", "carrie Fisher", "born", 1956);
|
||||
|
|
@ -370,7 +369,7 @@ public class GraphOfTheMoviesExample {
|
|||
noraE.addEdge("WROTE", whenHarryMetSally, "score", 10);
|
||||
|
||||
Vertex thatThingYouDo = graph.addVertex(T.label, "movie", "title",
|
||||
"That Thing You Do", "released", 1996);
|
||||
"That Thing You Do", "released", 1996);
|
||||
|
||||
Vertex livT = graph.addVertex(T.label, "person", "name", "Liv Tyler", "born", 1977);
|
||||
|
||||
|
|
@ -380,7 +379,7 @@ public class GraphOfTheMoviesExample {
|
|||
tomH.addEdge("DIRECTED", thatThingYouDo, "score", 10);
|
||||
|
||||
Vertex theReplacements = graph.addVertex(T.label, "movie", "title",
|
||||
"The Replacements", "released", 2000);
|
||||
"The Replacements", "released", 2000);
|
||||
|
||||
Vertex brooke = graph.addVertex(T.label, "person", "name", "brooke Langton", "born", 1970);
|
||||
Vertex gene = graph.addVertex(T.label, "person", "name", "gene Hackman", "born", 1930);
|
||||
|
|
@ -394,10 +393,10 @@ public class GraphOfTheMoviesExample {
|
|||
howard.addEdge("DIRECTED", theReplacements, "score", 10);
|
||||
|
||||
Vertex rescueDawn = graph.addVertex(T.label, "movie", "title",
|
||||
"rescueDawn", "released", 2006);
|
||||
"rescueDawn", "released", 2006);
|
||||
|
||||
Vertex christianB = graph.addVertex(T.label, "person", "name",
|
||||
"Christian Bale", "born", 1974);
|
||||
"Christian Bale", "born", 1974);
|
||||
Vertex zachG = graph.addVertex(T.label, "person", "name", "Zach Grenier", "born", 1954);
|
||||
|
||||
marshallB.addEdge("ACTED_IN", rescueDawn, "roles", "admiral");
|
||||
|
|
@ -407,7 +406,7 @@ public class GraphOfTheMoviesExample {
|
|||
wernerH.addEdge("DIRECTED", rescueDawn, "score", 10);
|
||||
|
||||
Vertex theBirdcage = graph.addVertex(T.label, "movie", "title",
|
||||
"The Birdcage", "released", 1996);
|
||||
"The Birdcage", "released", 1996);
|
||||
|
||||
Vertex mikeN = graph.addVertex(T.label, "person", "name", "Mike Nichols", "born", 1931);
|
||||
|
||||
|
|
@ -417,10 +416,10 @@ public class GraphOfTheMoviesExample {
|
|||
mikeN.addEdge("DIRECTED", theBirdcage, "score", 10);
|
||||
|
||||
Vertex unforgiven = graph.addVertex(T.label, "movie", "title",
|
||||
"unforgiven", "released", 1992);
|
||||
"unforgiven", "released", 1992);
|
||||
|
||||
Vertex richardH = graph.addVertex(T.label, "person", "name",
|
||||
"Richard Harris", "born", 1930);
|
||||
"Richard Harris", "born", 1930);
|
||||
Vertex clintE = graph.addVertex(T.label, "person", "name", "Richard Harris", "born", 1930);
|
||||
|
||||
richardH.addEdge("ACTED_IN", unforgiven, "roles", "English Bob");
|
||||
|
|
@ -429,7 +428,7 @@ public class GraphOfTheMoviesExample {
|
|||
clintE.addEdge("DIRECTED", unforgiven, "score", 10);
|
||||
|
||||
Vertex johnnyMnemonic = graph.addVertex(T.label, "movie", "title",
|
||||
"Johnny Mnemonic", "released", 1995);
|
||||
"Johnny Mnemonic", "released", 1995);
|
||||
|
||||
Vertex takeshi = graph.addVertex(T.label, "person", "name", "takeshi Kitano", "born", 1947);
|
||||
Vertex dina = graph.addVertex(T.label, "person", "name", "dina Meyer", "born", 1968);
|
||||
|
|
@ -443,24 +442,24 @@ public class GraphOfTheMoviesExample {
|
|||
robertL.addEdge("DIRECTED", johnnyMnemonic, "score", 10);
|
||||
|
||||
Vertex cloudatlas = graph.addVertex(T.label, "movie", "title",
|
||||
"Cloud atlas", "released", 2012);
|
||||
"Cloud atlas", "released", 2012);
|
||||
|
||||
Vertex halleB = graph.addVertex(T.label, "person", "name", "Halle Berry", "born", 1966);
|
||||
Vertex jimB = graph.addVertex(T.label, "person", "name", "Jim Broadbent", "born", 1949);
|
||||
Vertex tomT = graph.addVertex(T.label, "person", "name", "Tom Tykwer", "born", 1965);
|
||||
Vertex davidMitchell = graph.addVertex(T.label, "person", "name",
|
||||
"David Mitchell", "born", 1969);
|
||||
"David Mitchell", "born", 1969);
|
||||
Vertex stefanarndt = graph.addVertex(T.label, "person", "name",
|
||||
"Stefan arndt", "born", 1961);
|
||||
"Stefan arndt", "born", 1961);
|
||||
|
||||
tomH.addEdge("ACTED_IN", cloudatlas, "roles",
|
||||
"Zachry, Dr. Henry Goose, Isaac Sachs, Dermot Hoggins");
|
||||
"Zachry, Dr. Henry Goose, Isaac Sachs, Dermot Hoggins");
|
||||
hugo.addEdge("ACTED_IN", cloudatlas, "roles",
|
||||
"Bill Smoke, Haskell Moore, Tadeusz Kesselring, Nurse Noakes," +
|
||||
" Boardman Mephi, Old Georgie");
|
||||
"Bill Smoke, Haskell Moore, Tadeusz Kesselring, Nurse Noakes," +
|
||||
" Boardman Mephi, Old Georgie");
|
||||
halleB.addEdge("ACTED_IN", cloudatlas, "roles", "Luisa Rey, Jocasta ayrs, Ovid, Meronym");
|
||||
jimB.addEdge("ACTED_IN", cloudatlas, "roles",
|
||||
"Vyvyan ayrs, Captain Molyneux, Timothy Cavendish");
|
||||
"Vyvyan ayrs, Captain Molyneux, Timothy Cavendish");
|
||||
tomT.addEdge("DIRECTED", cloudatlas, "score", 10);
|
||||
lillyW.addEdge("DIRECTED", cloudatlas, "score", 10);
|
||||
lanaW.addEdge("DIRECTED", cloudatlas, "score", 10);
|
||||
|
|
@ -468,7 +467,7 @@ public class GraphOfTheMoviesExample {
|
|||
stefanarndt.addEdge("PRODUCED", cloudatlas, "score", 10);
|
||||
|
||||
Vertex theDaVinciCode = graph.addVertex(T.label, "movie", "title",
|
||||
"The Da Vinci Code", "released", 2006);
|
||||
"The Da Vinci Code", "released", 2006);
|
||||
|
||||
Vertex ianM = graph.addVertex(T.label, "person", "name", "Ian McKellen", "born", 1939);
|
||||
Vertex audreyT = graph.addVertex(T.label, "person", "name", "audrey Tautou", "born", 1976);
|
||||
|
|
@ -482,10 +481,10 @@ public class GraphOfTheMoviesExample {
|
|||
ronH.addEdge("DIRECTED", theDaVinciCode, "score", 10);
|
||||
|
||||
Vertex vforVendetta = graph.addVertex(T.label, "movie", "title",
|
||||
"The Da Vinci Code", "released", 2006);
|
||||
"The Da Vinci Code", "released", 2006);
|
||||
|
||||
Vertex natalieP = graph.addVertex(T.label, "person", "name",
|
||||
"Natalie Portman", "born", 1981);
|
||||
"Natalie Portman", "born", 1981);
|
||||
Vertex stephenR = graph.addVertex(T.label, "person", "name", "Stephen Rea", "born", 1946);
|
||||
Vertex johnH = graph.addVertex(T.label, "person", "name", "John Hurt", "born", 1940);
|
||||
Vertex benM = graph.addVertex(T.label, "person", "name", "Ben Miles", "born", 1967);
|
||||
|
|
@ -503,14 +502,14 @@ public class GraphOfTheMoviesExample {
|
|||
lanaW.addEdge("WROTE", vforVendetta, "score", 10);
|
||||
|
||||
Vertex speedRacer = graph.addVertex(T.label, "movie", "title",
|
||||
"Speed Racer", "released", 2008);
|
||||
"Speed Racer", "released", 2008);
|
||||
|
||||
Vertex matthewF = graph.addVertex(T.label, "person", "name", "Matthew Fox", "born", 1966);
|
||||
Vertex emileH = graph.addVertex(T.label, "person", "name", "Emile Hirsch", "born", 1985);
|
||||
Vertex johnG = graph.addVertex(T.label, "person", "name", "John Goodman", "born", 1940);
|
||||
Vertex susanS = graph.addVertex(T.label, "person", "name", "Susan Sarandon", "born", 1966);
|
||||
Vertex christinaR = graph.addVertex(T.label, "person", "name",
|
||||
"Christina Ricci", "born", 1980);
|
||||
"Christina Ricci", "born", 1980);
|
||||
Vertex rain = graph.addVertex(T.label, "person", "name", "Rain", "born", 1982);
|
||||
|
||||
emileH.addEdge("ACTED_IN", speedRacer, "roles", "Speed Racer");
|
||||
|
|
@ -527,7 +526,7 @@ public class GraphOfTheMoviesExample {
|
|||
joelS.addEdge("PRODUCED", speedRacer, "score", 10);
|
||||
|
||||
Vertex ninjaassassin = graph.addVertex(T.label, "movie", "title",
|
||||
"Speed Racer", "released", 2009);
|
||||
"Speed Racer", "released", 2009);
|
||||
|
||||
Vertex naomieH = graph.addVertex(T.label, "person", "name", "Naomie Harris", "born", 1982);
|
||||
|
||||
|
|
@ -541,15 +540,15 @@ public class GraphOfTheMoviesExample {
|
|||
joelS.addEdge("PRODUCED", ninjaassassin, "score", 10);
|
||||
|
||||
Vertex theGreenMile = graph.addVertex(T.label, "movie", "title",
|
||||
"The Green Mile", "released", 1999);
|
||||
"The Green Mile", "released", 1999);
|
||||
|
||||
Vertex michaelD = graph.addVertex(T.label, "person", "name",
|
||||
"Michael Clarke Duncan", "born", 1957);
|
||||
"Michael Clarke Duncan", "born", 1957);
|
||||
Vertex davidM = graph.addVertex(T.label, "person", "name", "David Morse", "born", 1953);
|
||||
Vertex samR = graph.addVertex(T.label, "person", "name", "Sam Rockwell", "born", 1968);
|
||||
Vertex garyS = graph.addVertex(T.label, "person", "name", "Gary Sinise", "born", 1955);
|
||||
Vertex patriciaC = graph.addVertex(T.label, "person", "name",
|
||||
"Patricia Clarkson", "born", 1959);
|
||||
"Patricia Clarkson", "born", 1959);
|
||||
Vertex frankD = graph.addVertex(T.label, "person", "name", "Frank Darabont", "born", 1959);
|
||||
|
||||
tomH.addEdge("ACTED_IN", theGreenMile, "roles", "Paul Edgecomb");
|
||||
|
|
@ -563,7 +562,7 @@ public class GraphOfTheMoviesExample {
|
|||
frankD.addEdge("DIRECTED", theGreenMile, "score", 10);
|
||||
|
||||
Vertex frostNixon = graph.addVertex(T.label, "movie", "title",
|
||||
"Frost/Nixon", "released", 2008);
|
||||
"Frost/Nixon", "released", 2008);
|
||||
|
||||
Vertex frankL = graph.addVertex(T.label, "person", "name", "Frank Langella", "born", 1938);
|
||||
Vertex michaelS = graph.addVertex(T.label, "person", "name", "Michael Sheen", "born", 1969);
|
||||
|
|
@ -602,7 +601,7 @@ public class GraphOfTheMoviesExample {
|
|||
Vertex twister = graph.addVertex(T.label, "movie", "title", "twister", "released", 1996);
|
||||
|
||||
Vertex philipH = graph.addVertex(T.label, "person", "name",
|
||||
"Philip Seymour Hoffman", "born", 1967);
|
||||
"Philip Seymour Hoffman", "born", 1967);
|
||||
Vertex janB = graph.addVertex(T.label, "person", "name", "Jan de Bont", "born", 1943);
|
||||
|
||||
billPax.addEdge("ACTED_IN", twister, "roles", "Bill Harding");
|
||||
|
|
@ -614,14 +613,15 @@ public class GraphOfTheMoviesExample {
|
|||
Vertex castaway = graph.addVertex(T.label, "movie", "title", "Cast away", "released", 2000);
|
||||
|
||||
Vertex robertZ = graph.addVertex(T.label, "person", "name",
|
||||
"Robert Zemeckis", "born", 1951);
|
||||
"Robert Zemeckis", "born", 1951);
|
||||
|
||||
tomH.addEdge("ACTED_IN", castaway, "roles", "Chuck Noland");
|
||||
helenH.addEdge("ACTED_IN", castaway, "roles", "Kelly Frears");
|
||||
robertZ.addEdge("DIRECTED", castaway, "score", 10);
|
||||
|
||||
Vertex oneFlewOvertheCuckoosNest = graph.addVertex(T.label, "movie", "title",
|
||||
"One Flew Over the Cuckoo's Nest", "released", 1975);
|
||||
"One Flew Over the Cuckoo's Nest",
|
||||
"released", 1975);
|
||||
|
||||
Vertex milosF = graph.addVertex(T.label, "person", "name", "Milos Forman", "born", 1932);
|
||||
|
||||
|
|
@ -630,7 +630,7 @@ public class GraphOfTheMoviesExample {
|
|||
milosF.addEdge("DIRECTED", oneFlewOvertheCuckoosNest, "score", 10);
|
||||
|
||||
Vertex somethingsGottaGive = graph.addVertex(T.label, "movie", "title",
|
||||
"Something's Gotta Give", "released", 2003);
|
||||
"Something's Gotta Give", "released", 2003);
|
||||
|
||||
Vertex dianeK = graph.addVertex(T.label, "person", "name", "Diane Keaton", "born", 1946);
|
||||
Vertex nancyM = graph.addVertex(T.label, "person", "name", "Nancy Meyers", "born", 1949);
|
||||
|
|
@ -643,7 +643,7 @@ public class GraphOfTheMoviesExample {
|
|||
nancyM.addEdge("WROTE", somethingsGottaGive, "score", 10);
|
||||
|
||||
Vertex bicentennialMan = graph.addVertex(T.label, "movie", "title",
|
||||
"Bicentennial Man", "released", 2000);
|
||||
"Bicentennial Man", "released", 2000);
|
||||
|
||||
Vertex chrisC = graph.addVertex(T.label, "person", "name", "Chris Columbus", "born", 1958);
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ public class GraphOfTheMoviesExample {
|
|||
chrisC.addEdge("DIRECTED", bicentennialMan, "score", 10);
|
||||
|
||||
Vertex charlieWilsonsWar = graph.addVertex(T.label, "movie", "title",
|
||||
"Charlie Wilson's War", "released", 2007);
|
||||
"Charlie Wilson's War", "released", 2007);
|
||||
|
||||
Vertex juliaR = graph.addVertex(T.label, "person", "name", "Julia Roberts", "born", 1967);
|
||||
|
||||
|
|
@ -662,14 +662,14 @@ public class GraphOfTheMoviesExample {
|
|||
mikeN.addEdge("DIRECTED", charlieWilsonsWar, "score", 10);
|
||||
|
||||
Vertex thePolarExpress = graph.addVertex(T.label, "movie", "title",
|
||||
"The Polar Express", "released", 2004);
|
||||
"The Polar Express", "released", 2004);
|
||||
|
||||
tomH.addEdge("ACTED_IN", thePolarExpress, "roles", "Hero Boy");
|
||||
|
||||
robertZ.addEdge("DIRECTED", thePolarExpress, "score", 10);
|
||||
|
||||
Vertex aLeagueofTheirOwn = graph.addVertex(T.label, "movie", "title",
|
||||
"a League of Their Own", "released", 1992);
|
||||
"a League of Their Own", "released", 1992);
|
||||
|
||||
Vertex madonna = graph.addVertex(T.label, "person", "name", "madonna", "born", 1954);
|
||||
Vertex geenaD = graph.addVertex(T.label, "person", "name", "Geena Davis", "born", 1956);
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.backend.BackendException;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
|
||||
import com.datastax.driver.core.exceptions.NoHostAvailableException;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.backend.BackendException;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
|
||||
import com.datastax.driver.core.exceptions.NoHostAvailableException;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -17,13 +17,12 @@
|
|||
|
||||
package org.apache.hugegraph.example;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.schema.SchemaManager;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.structure.T;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* Perf test for: insert vertices with indexes in order
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@ package org.apache.hugegraph.example;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* Perf test for: query vertices with indexes and limit
|
||||
|
|
@ -34,6 +33,7 @@ public class PerfExample4 extends PerfExample3 {
|
|||
|
||||
/**
|
||||
* Main method
|
||||
*
|
||||
* @param args 3 arguments, 1st should be 1, meaning single thread,
|
||||
* product of 2nd and 3rd is total number of "person" vertices
|
||||
* @throws InterruptedException
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public abstract class PerfExampleBase {
|
|||
* @throws Exception execute may throw Exception
|
||||
*/
|
||||
public void testInsertPerf(GraphManager graph, int threadCount, int times, int multiple)
|
||||
throws Exception {
|
||||
throws Exception {
|
||||
// Total vertices/edges
|
||||
long n = (long) threadCount * times * multiple;
|
||||
long vertices = (PERSON_NUM + SOFTWARE_NUM) * n;
|
||||
|
|
@ -113,7 +113,7 @@ public abstract class PerfExampleBase {
|
|||
}
|
||||
|
||||
public void testQueryVertexPerf(GraphManager graph, int threadCount, int times, int multiple)
|
||||
throws Exception {
|
||||
throws Exception {
|
||||
long cost = this.execute(graph, i -> {
|
||||
this.testQueryVertex(graph, threadCount, i, multiple);
|
||||
}, threadCount);
|
||||
|
|
@ -125,7 +125,7 @@ public abstract class PerfExampleBase {
|
|||
}
|
||||
|
||||
public void testQueryEdgePerf(GraphManager graph, int threadCount, int times, int multiple)
|
||||
throws Exception {
|
||||
throws Exception {
|
||||
long cost = this.execute(graph, i -> {
|
||||
this.testQueryEdge(graph, threadCount, i, multiple);
|
||||
}, threadCount);
|
||||
|
|
@ -236,6 +236,7 @@ public abstract class PerfExampleBase {
|
|||
}
|
||||
|
||||
protected static class GraphManager {
|
||||
|
||||
private final HugeGraph hugegraph;
|
||||
private final Cache<Id, Object> cache = CacheManager.instance().cache("perf-test");
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ package org.apache.hugegraph.example;
|
|||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.collections.IteratorUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.HugeGraph;
|
||||
import org.apache.hugegraph.backend.id.Id;
|
||||
|
|
@ -32,6 +30,7 @@ import org.apache.hugegraph.task.TaskScheduler;
|
|||
import org.apache.hugegraph.task.TaskStatus;
|
||||
import org.apache.hugegraph.testutil.Whitebox;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class TaskExample {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,10 +17,9 @@
|
|||
|
||||
package org.apache.hugegraph.example;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.apache.hugegraph.HugeFactory;
|
||||
import org.apache.hugegraph.util.Log;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class ThreadRangePerfTest {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
<!-- Normal server log config -->
|
||||
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
|
||||
immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1day or 50MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="50MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
|
||||
<DefaultRolloverStrategy max="5">
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
<IfFileName glob="*/*.log"/>
|
||||
<!-- Limit log amount & size -->
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="2GB" />
|
||||
<IfAccumulatedFileCount exceeds="100" />
|
||||
<IfAccumulatedFileSize exceeds="2GB"/>
|
||||
<IfAccumulatedFileCount exceeds="100"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
@ -54,15 +54,15 @@
|
|||
|
||||
<!-- Separate & compress audit log, buffer size is 512KB -->
|
||||
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
|
||||
bufferSize="524288" immediateFlush="false">
|
||||
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<!-- Use simple format for audit log to speed up -->
|
||||
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
|
||||
<!-- Trigger after exceeding 1hour or 500MB -->
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="500MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
|
||||
<DefaultRolloverStrategy max="2">
|
||||
|
|
@ -70,8 +70,8 @@
|
|||
<IfFileName glob="*/*.gz"/>
|
||||
<IfLastModified age="60d"/>
|
||||
<IfAny>
|
||||
<IfAccumulatedFileSize exceeds="5GB" />
|
||||
<IfAccumulatedFileCount exceeds="500" />
|
||||
<IfAccumulatedFileSize exceeds="5GB"/>
|
||||
<IfAccumulatedFileCount exceeds="500"/>
|
||||
</IfAny>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
|
|
|
|||
Loading…
Reference in New Issue