create api module (#41)
authorhouzhizhen <houzhizhen_101@163.com>
Thu, 29 Apr 2021 09:13:53 +0000 (17:13 +0800)
committerGitHub <noreply@github.com>
Thu, 29 Apr 2021 09:13:53 +0000 (17:13 +0800)
commita554a5a9741d21e54a8c7f27fe95080f035a7acc
treee28fbd5f79cc13998b80ca75b528b83831912470
parente700772a32d5f44673be87e6c3549cb4c42d34f7
create api module (#41)

* move algorithm's used classes to api
* add module computer-api
* signal bsp at end of init in WorkerService and MasterService
* make ValueFactory abstract and add BuiltinValueFactory
* rename USER_DEFINED to CUSTOM_VALUE in ValueType
* Reduce call ComputerContext.instance() directly
* synchronious UnitTestBase.updateWithRequiredOptions and return Config
* pass Aggregator4Master to MasterComputation#init
* add parameter MasterContext in MasterComputation.close
124 files changed:
computer-api/pom.xml [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator4Master.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator4Master.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator4Worker.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/aggregator/Aggregator4Worker.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/allocator/Allocator.java [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/allocator/Recyclable.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/allocator/Recyclable.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/allocator/RecyclerReference.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/allocator/RecyclerReference.java with 80% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/Combiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/Combiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/DoubleValueSumCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/DoubleValueSumCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/LongValueSumCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/LongValueSumCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeNewPropertiesCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeNewPropertiesCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeOldPropertiesCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeOldPropertiesCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/OverwriteCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/OverwriteCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/PropertiesCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/PropertiesCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/ValueMaxCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/ValueMaxCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/combiner/ValueMinCombiner.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/combiner/ValueMinCombiner.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/common/ComputerContext.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/common/ComputerContext.java with 62% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/common/SerialEnum.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/common/SerialEnum.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/common/exception/ComputerException.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/common/exception/ComputerException.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/config/Config.java [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/config/Null.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/config/Null.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/GraphFactory.java [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/Edge.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/Edge.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/Edges.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/Edges.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/id/Id.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/id/Id.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/id/IdType.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/id/IdType.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/properties/Properties.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/properties/Properties.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/BooleanValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/BooleanValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/DoubleValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/DoubleValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/FloatValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/FloatValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValue.java with 75% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValueList.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValueList.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValueListList.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValueListList.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IntValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IntValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ListValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ListValue.java with 89% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/LongValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/LongValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/NullValue.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/NullValue.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/Value.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/Value.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ValueFactory.java [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ValueType.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ValueType.java with 97% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/graph/vertex/Vertex.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/vertex/Vertex.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/io/GraphInput.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/GraphInput.java with 94% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/io/GraphOutput.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/GraphOutput.java with 94% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/io/Readable.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/Readable.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/io/Writable.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/Writable.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/master/DefaultMasterComputation.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/master/DefaultMasterComputation.java with 87% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/master/MasterComputation.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/master/MasterComputation.java with 80% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/master/MasterComputationContext.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/master/MasterContext.java with 93% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/master/MasterContext.java [new file with mode: 0644]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/util/BytesUtil.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/util/BytesUtil.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/worker/Computation.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/Computation.java with 98% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/worker/ComputationContext.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/ComputationContext.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/worker/FilterComputation.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/FilterComputation.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/worker/ReduceComputation.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/ReduceComputation.java with 100% similarity]
computer-api/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerContext.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerContext.java with 100% similarity]
computer-core/pom.xml
computer-core/src/main/java/com/baidu/hugegraph/computer/core/allocator/DefaultAllocator.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/allocator/Allocator.java with 84% similarity]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/allocator/RecycleHandler.java [new file with mode: 0644]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/bsp/Bsp4Master.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/bsp/Bsp4Worker.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/config/ComputerOptions.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/config/DefaultConfig.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/config/Config.java with 95% similarity]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/config/HotConfig.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/BuiltinGraphFactory.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/GraphFactory.java with 64% similarity]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/DefaultEdge.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/edge/DefaultEdges.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/id/LongId.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/id/Utf8Id.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/id/UuidId.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/properties/DefaultProperties.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/BuiltinValueFactory.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ValueFactory.java with 80% similarity]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/graph/vertex/DefaultVertex.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/input/HugeConverter.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/CsvStructGraphOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/GraphOutputFactory.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/JsonStructGraphOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/OptimizedStreamGraphInput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/OptimizedStreamGraphOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/RandomAccessInput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/RandomAccessOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/StreamGraphInput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/StreamGraphOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/io/StructGraphOutput.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/master/MasterService.java
computer-core/src/main/java/com/baidu/hugegraph/computer/core/util/ComputerContextUtil.java [new file with mode: 0644]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/util/IdValueUtil.java [new file with mode: 0644]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/util/SerializeUtil.java [moved from computer-core/src/main/java/com/baidu/hugegraph/computer/core/util/ReadWriteUtil.java with 78% similarity]
computer-core/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerService.java
computer-test/pom.xml
computer-test/src/main/java/com/baidu/hugegraph/computer/core/UnitTestBase.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/UnitTestSuite.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/allocator/AllocatorTestSuite.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/allocator/DefaultAllocatorTest.java [moved from computer-test/src/main/java/com/baidu/hugegraph/computer/core/allocator/AllocatorTest.java with 82% similarity]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/bsp/EtcdBspTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeNewPropertiesCombinerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/combiner/MergeOldPropertiesCombinerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/combiner/OverwriteCombinerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/common/CommonTestSuite.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/common/ConfigTest.java [deleted file]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/common/FakeMasterComputation.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/config/ConfigTestSuite.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/config/DefaultConfigTest.java [moved from computer-test/src/main/java/com/baidu/hugegraph/computer/core/config/ConfigTest.java with 77% similarity]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/GraphTestSuite.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/id/LongIdTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/id/Utf8IdTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/id/UuidIdTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/partition/HashPartitionerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/value/BuiltinValueFactoryTest.java [new file with mode: 0644]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/value/IdValueTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/value/MockCustomValue.java [new file with mode: 0644]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/graph/value/ValueFactoryTest.java [deleted file]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/input/HugeConverterTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/input/InputSplitDataTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/io/CsvStructGraphOutputTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/io/JsonStructGraphOutputTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/io/StreamGraphOutputInputTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/connection/ConnectionManagerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/netty/AbstractNetworkTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/netty/NettyClientFactoryTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/netty/NettyTransportServerTest.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/util/IdValueUtilTest.java [new file with mode: 0644]
computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/MockMasterComputation.java
computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerServiceTest.java
pom.xml