io.atomix.primitive.PrimitiveBuilder Java Examples
The following examples show how to use
io.atomix.primitive.PrimitiveBuilder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Atomix.java From atomix with Apache License 2.0 | 5 votes |
@Override public <B extends PrimitiveBuilder<B, C, P>, C extends PrimitiveConfig<C>, P extends SyncPrimitive> B primitiveBuilder( String name, PrimitiveType<B, C, P> primitiveType) { checkRunning(); return primitives.primitiveBuilder(name, primitiveType); }
Example #2
Source File: CoreTransactionService.java From atomix with Apache License 2.0 | 5 votes |
/** * Completes an individual participant in a transaction by loading the primitive by type/protocol/partition group and * applying the given completion function to it. */ @SuppressWarnings("unchecked") private CompletableFuture<Void> completeParticipant( ParticipantInfo participantInfo, Function<Transactional<?>, CompletableFuture<Void>> completionFunction) { // Look up the primitive type for the participant. If the primitive type is not found, return an exception. PrimitiveType primitiveType = managementService.getPrimitiveTypeRegistry().getPrimitiveType(participantInfo.type()); if (primitiveType == null) { return Futures.exceptionalFuture(new TransactionException("Failed to locate primitive type " + participantInfo.type() + " for participant " + participantInfo.name())); } // Look up the protocol type for the participant. PrimitiveProtocol.Type protocolType = managementService.getProtocolTypeRegistry().getProtocolType(participantInfo.protocol()); if (protocolType == null) { return Futures.exceptionalFuture(new TransactionException("Failed to locate protocol type for participant " + participantInfo.name())); } // Look up the partition group in which the primitive is stored. PartitionGroup partitionGroup; if (participantInfo.group() == null) { partitionGroup = managementService.getPartitionService().getPartitionGroup(protocolType); } else { partitionGroup = managementService.getPartitionService().getPartitionGroup(participantInfo.group()); } // If the partition group is not found, return an exception. if (partitionGroup == null) { return Futures.exceptionalFuture(new TransactionException("Failed to locate partition group for participant " + participantInfo.name())); } PrimitiveBuilder builder = primitiveType.newBuilder(participantInfo.name(), primitiveType.newConfig(), managementService); ((ProxyCompatibleBuilder) builder).withProtocol(partitionGroup.newProtocol()); DistributedPrimitive primitive = builder.build(); return completionFunction.apply((Transactional<?>) primitive); }
Example #3
Source File: ClusterPrimitiveType.java From submarine with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #4
Source File: ClusterPrimitiveType.java From zeppelin with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #5
Source File: SessionIdGeneratorType.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String name, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #6
Source File: PrimaryElectorType.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String name, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #7
Source File: PrimaryBackupTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #8
Source File: TestPrimitiveType.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #9
Source File: RaftTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #10
Source File: RaftServiceManagerTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { return null; }
Example #11
Source File: DistributedLogTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #12
Source File: RaftPerformanceTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #13
Source File: RaftFuzzTest.java From atomix with Apache License 2.0 | 4 votes |
@Override public PrimitiveBuilder newBuilder(String primitiveName, PrimitiveConfig config, PrimitiveManagementService managementService) { throw new UnsupportedOperationException(); }
Example #14
Source File: CorePrimitivesService.java From atomix with Apache License 2.0 | 4 votes |
@Override public <B extends PrimitiveBuilder<B, C, P>, C extends PrimitiveConfig<C>, P extends SyncPrimitive> B primitiveBuilder( String name, PrimitiveType<B, C, P> primitiveType) { return primitiveType.newBuilder(name, configService.getConfig(name, primitiveType), managementService); }