boolean exec = ep.getRoles().getJavaExecutor(); boolean coord = ep.getRoles().getSqlQuery();
@Override public void start() throws Exception { final NodeEndpoint endpoint = context.get().getEndpoint(); endpointName = endpoint.getAddress() + ":" + endpoint.getUserPort(); logger.info("Starting NodeRegistration for {}", endpointName); Roles roles = endpoint.getRoles(); if (roles.getMaster()) { registrationHandles.add(coord.get().getServiceSet(ClusterCoordinator.Role.MASTER).register(endpoint)); } if (roles.getSqlQuery()) { registrationHandles.add(coord.get().getServiceSet(ClusterCoordinator.Role.COORDINATOR).register(endpoint)); } if (roles.getJavaExecutor()) { registrationHandles.add(coord.get().getServiceSet(ClusterCoordinator.Role.EXECUTOR).register(endpoint)); } logger.info("NodeRegistration is up for {}", endpointName); }
/** * <code>optional .exec.Roles roles = 5;</code> * * <pre> * optional int32 __unused = 4; * </pre> */ public Builder mergeRoles(com.dremio.exec.proto.CoordinationProtos.Roles value) { if (rolesBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && roles_ != com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance()) { roles_ = com.dremio.exec.proto.CoordinationProtos.Roles.newBuilder(roles_).mergeFrom(value).buildPartial(); } else { roles_ = value; } onChanged(); } else { rolesBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; return this; } /**
if (hasRoles()) { result = result && getRoles() .equals(other.getRoles());
break; case 5: builder.setRoles(input.mergeObject(com.dremio.exec.proto.CoordinationProtos.Roles.newBuilder(), com.dremio.exec.proto.SchemaCoordinationProtos.Roles.MERGE));
result = result && (hasSqlQuery() == other.hasSqlQuery()); if (hasSqlQuery()) { result = result && (getSqlQuery() == other.getSqlQuery()); result = result && (hasLogicalPlan() == other.hasLogicalPlan()); if (hasLogicalPlan()) { result = result && (getLogicalPlan() == other.getLogicalPlan()); result = result && (hasPhysicalPlan() == other.hasPhysicalPlan()); if (hasPhysicalPlan()) { result = result && (getPhysicalPlan() == other.getPhysicalPlan()); result = result && (hasJavaExecutor() == other.hasJavaExecutor()); if (hasJavaExecutor()) { result = result && (getJavaExecutor() == other.getJavaExecutor()); result = result && (hasDistributedCache() == other.hasDistributedCache()); if (hasDistributedCache()) { result = result && (getDistributedCache() == other.getDistributedCache()); result = result && (hasMaster() == other.hasMaster()); if (hasMaster()) { result = result && (getMaster() == other.getMaster());
hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasSqlQuery()) { hash = (37 * hash) + SQL_QUERY_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getSqlQuery()); if (hasLogicalPlan()) { hash = (37 * hash) + LOGICAL_PLAN_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getLogicalPlan()); if (hasPhysicalPlan()) { hash = (37 * hash) + PHYSICAL_PLAN_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getPhysicalPlan()); if (hasJavaExecutor()) { hash = (37 * hash) + JAVA_EXECUTOR_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getJavaExecutor()); if (hasDistributedCache()) { hash = (37 * hash) + DISTRIBUTED_CACHE_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getDistributedCache()); if (hasMaster()) { hash = (37 * hash) + MASTER_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getMaster()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
public com.dremio.exec.proto.CoordinationProtos.Roles buildPartial() { com.dremio.exec.proto.CoordinationProtos.Roles result = new com.dremio.exec.proto.CoordinationProtos.Roles(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public Builder clear() { super.clear(); address_ = ""; bitField0_ = (bitField0_ & ~0x00000001); userPort_ = 0; bitField0_ = (bitField0_ & ~0x00000002); fabricPort_ = 0; bitField0_ = (bitField0_ & ~0x00000004); if (rolesBuilder_ == null) { roles_ = com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance(); } else { rolesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); startTime_ = 0L; bitField0_ = (bitField0_ & ~0x00000010); provisionId_ = ""; bitField0_ = (bitField0_ & ~0x00000020); maxDirectMemory_ = 0L; bitField0_ = (bitField0_ & ~0x00000040); availableCores_ = 0; bitField0_ = (bitField0_ & ~0x00000080); return this; }
public Builder mergeFrom(com.dremio.exec.proto.CoordinationProtos.Roles other) { if (other == com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance()) return this; if (other.hasSqlQuery()) { setSqlQuery(other.getSqlQuery()); } if (other.hasLogicalPlan()) { setLogicalPlan(other.getLogicalPlan()); } if (other.hasPhysicalPlan()) { setPhysicalPlan(other.getPhysicalPlan()); } if (other.hasJavaExecutor()) { setJavaExecutor(other.getJavaExecutor()); } if (other.hasDistributedCache()) { setDistributedCache(other.getDistributedCache()); } if (other.hasMaster()) { setMaster(other.getMaster()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional .exec.Roles roles = 5;</code> * * <pre> * optional int32 __unused = 4; * </pre> */ public Builder clearRoles() { if (rolesBuilder_ == null) { roles_ = com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance(); onChanged(); } else { rolesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); return this; } /**
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.dremio.exec.proto.CoordinationProtos.Roles prototype) {
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.CoordinationProtos.Roles message) throws java.io.IOException { if(message.hasSqlQuery()) output.writeBool(1, message.getSqlQuery(), false); if(message.hasLogicalPlan()) output.writeBool(2, message.getLogicalPlan(), false); if(message.hasPhysicalPlan()) output.writeBool(3, message.getPhysicalPlan(), false); if(message.hasJavaExecutor()) output.writeBool(4, message.getJavaExecutor(), false); if(message.hasDistributedCache()) output.writeBool(5, message.getDistributedCache(), false); if(message.hasMaster()) output.writeBool(100, message.getMaster(), false); } public boolean isInitialized(com.dremio.exec.proto.CoordinationProtos.Roles message)
public Builder toBuilder() { return newBuilder(this); }
public ServiceHolder(BufferAllocator allocator, Provider<Iterable<NodeEndpoint>> nodeProvider, PDFSMode mode, String name) throws Exception{ this.allocator = allocator.newChildAllocator(name, 0, Long.MAX_VALUE); pool = new CloseableThreadPool(name); fabric = new FabricServiceImpl(HOSTNAME, 9970, true, THREAD_COUNT, this.allocator, RESERVATION, MAX_ALLOCATION, TIMEOUT, pool); fabric.start(); endpoint = NodeEndpoint.newBuilder() .setAddress(fabric.getAddress()).setFabricPort(fabric.getPort()) .setRoles(Roles.newBuilder().setJavaExecutor(mode == PDFSMode.DATA)) .build(); service = new PDFSService(DirectProvider.wrap((FabricService) fabric), DirectProvider.wrap(endpoint), nodeProvider, DremioTest.DEFAULT_SABOT_CONFIG, this.allocator, mode); service.start(); fileSystem = service.createFileSystem(); }
public com.dremio.exec.proto.CoordinationProtos.Roles getDefaultInstanceForType() { return com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance(); }
public static Builder newBuilder(com.dremio.exec.proto.CoordinationProtos.Roles prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public static Roles toEndpointRoles(Set<Role> roles) { Roles.Builder builder = Roles.newBuilder(); for(Role role: Role.values()) { role.updateEndpointRoles(builder, roles.contains(role)); } return builder.build(); } }
private void initFields() { address_ = ""; userPort_ = 0; fabricPort_ = 0; roles_ = com.dremio.exec.proto.CoordinationProtos.Roles.getDefaultInstance(); startTime_ = 0L; provisionId_ = ""; maxDirectMemory_ = 0L; availableCores_ = 0; } private byte memoizedIsInitialized = -1;
@Override protected boolean contains(Roles roles) { return roles.getSqlQuery(); } },