private R buildUnaryDispatchRequest(R request, Fragment fragment) { if (!(request instanceof Processor.UnaryProcess)) { throw new IllegalArgumentException("request type error: " + request.getClass().getCanonicalName()); } R result = null; Processor.UnaryProcess typedRequest = (Processor.UnaryProcess) request; storageLocatorBuilder.clear() .mergeFrom(typedRequest.getOperand()) .setFragment(fragment.getFragmentOrder()); unaryProcessBuilder.clear(); unaryProcessBuilder.mergeFrom(typedRequest) .setOperand(storageLocatorBuilder.build()); result = (R) unaryProcessBuilder.build(); return result; }
private R buildBinaryDispatchRequest(R request, Fragment fragment) { if (!(request instanceof Processor.BinaryProcess)) { throw new IllegalArgumentException("request type error: " + request.getClass().getCanonicalName()); } R result = null; Processor.BinaryProcess typedRequest = (Processor.BinaryProcess) request; storageLocatorBuilder.clear() .mergeFrom(typedRequest.getLeft()) .setFragment(fragment.getFragmentOrder()); StorageBasic.StorageLocator left = storageLocatorBuilder.build(); storageLocatorBuilder.clear() .mergeFrom(typedRequest.getRight()) .setFragment(fragment.getFragmentOrder()); StorageBasic.StorageLocator right = storageLocatorBuilder.build(); binaryProcessBuilder.clear() .mergeFrom(typedRequest) .setLeft(left) .setRight(right); result = (R) binaryProcessBuilder.build(); return result; }
public Builder mergeFrom(com.webank.ai.fate.api.eggroll.storage.StorageBasic.StorageLocator other) { if (other == com.webank.ai.fate.api.eggroll.storage.StorageBasic.StorageLocator.getDefaultInstance()) return this; if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (!other.getNamespace().isEmpty()) { namespace_ = other.namespace_; onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getFragment() != 0) { setFragment(other.getFragment()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
.setFragment(passedInTransferDataDesc.getStorageLocator().getFragment()) // total fragment count .setType(passedInTransferDataDesc.getStorageLocator().getType());
.setName(FederationConstants.OBJECT_STORAGE_NAMESPACE) .setType(StorageBasic.StorageType.LMDB) .setFragment(0) .build();
public Builder mergeFrom(com.webank.ai.fate.api.eggroll.storage.StorageBasic.StorageLocator other) { if (other == com.webank.ai.fate.api.eggroll.storage.StorageBasic.StorageLocator.getDefaultInstance()) return this; if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (!other.getNamespace().isEmpty()) { namespace_ = other.namespace_; onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getFragment() != 0) { setFragment(other.getFragment()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }