public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); } { int dataSize = 0; for (int i = 0; i < functionSignature_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(functionSignature_.getByteString(i)); } size += dataSize; size += 1 * getFunctionSignatureList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.Jar other) { if (other == org.apache.drill.exec.proto.UserBitShared.Jar.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); } if (!other.functionSignature_.isEmpty()) { if (functionSignature_.isEmpty()) { functionSignature_ = other.functionSignature_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureFunctionSignatureIsMutable(); functionSignature_.addAll(other.functionSignature_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getNameBytes()); } for (int i = 0; i < functionSignature_.size(); i++) { output.writeBytes(2, functionSignature_.getByteString(i)); } getUnknownFields().writeTo(output); }
String.format("The following UDFs in jar %s have been unregistered:\n%s", jarName, deletedJar.getFunctionSignatureList()));
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
jars.add(Jar.newBuilder().setName(jarManager.getBinaryName()).addAllFunctionSignature(functions).build()); Registry updatedRegistry = Registry.newBuilder().addAllJar(jars).build(); try {
List<Jar> jars = Lists.newArrayList(); for (Jar j : registry.getJarList()) { if (j.getName().equals(jarName)) { jarToBeDeleted = j; } else {
/** * Validates jar and its functions against remote jars. * First checks if there is no duplicate by jar name and then looks for duplicates among functions. * * @param remoteJars list of remote jars to validate against * @param jarName jar name to be validated * @param functions list of functions present in jar to be validated * @throws JarValidationException in case of jar with the same name was found * @throws FunctionValidationException in case duplicated function was found */ private void validateAgainstRemoteRegistry(List<Jar> remoteJars, String jarName, List<String> functions) { for (Jar remoteJar : remoteJars) { if (remoteJar.getName().equals(jarName)) { throw new JarValidationException(String.format("Jar with %s name has been already registered", jarName)); } for (String remoteFunction : remoteJar.getFunctionSignatureList()) { for (String func : functions) { if (remoteFunction.equals(func)) { throw new FunctionValidationException( String.format("Found duplicated function in %s: %s", remoteJar.getName(), remoteFunction)); } } } } }
/** * Return list of jars that are missing in local function registry * but present in remote function registry. * Also updates version holder with remote function registry version. * * @param remoteFunctionRegistry remote function registry * @param localFunctionRegistry local function registry * @param version holder for remote function registry version * @return list of missing jars */ private List<String> getMissingJars(RemoteFunctionRegistry remoteFunctionRegistry, LocalFunctionRegistry localFunctionRegistry, DataChangeVersion version) { List<Jar> remoteJars = remoteFunctionRegistry.getRegistry(version).getJarList(); List<String> localJars = localFunctionRegistry.getAllJarNames(); List<String> missingJars = new ArrayList<>(); for (Jar jar : remoteJars) { if (!localJars.contains(jar.getName())) { missingJars.add(jar.getName()); } } return missingJars; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); } { int dataSize = 0; for (int i = 0; i < functionSignature_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(functionSignature_.getByteString(i)); } size += dataSize; size += 1 * getFunctionSignatureList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.Jar other) { if (other == org.apache.drill.exec.proto.UserBitShared.Jar.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); } if (!other.functionSignature_.isEmpty()) { if (functionSignature_.isEmpty()) { functionSignature_ = other.functionSignature_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureFunctionSignatureIsMutable(); functionSignature_.addAll(other.functionSignature_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public org.apache.drill.exec.proto.UserBitShared.Jar buildPartial() { org.apache.drill.exec.proto.UserBitShared.Jar result = new org.apache.drill.exec.proto.UserBitShared.Jar(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.name_ = name_; if (((bitField0_ & 0x00000002) == 0x00000002)) { functionSignature_ = new com.google.protobuf.UnmodifiableLazyStringList( functionSignature_); bitField0_ = (bitField0_ & ~0x00000002); } result.functionSignature_ = functionSignature_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.UserBitShared.Registry.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.addJar(input.mergeObject(org.apache.drill.exec.proto.UserBitShared.Jar.newBuilder(), org.apache.drill.exec.proto.SchemaUserBitShared.Jar.MERGE)); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.Registry.Builder builder)
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserBitShared.Jar prototype) {
public org.apache.drill.exec.proto.UserBitShared.Jar getDefaultInstanceForType() { return org.apache.drill.exec.proto.UserBitShared.Jar.getDefaultInstance(); }
public static Builder newBuilder(org.apache.drill.exec.proto.UserBitShared.Jar prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * <code>repeated .exec.shared.Jar jar = 1;</code> */ public org.apache.drill.exec.proto.UserBitShared.Jar.Builder addJarBuilder( int index) { return getJarFieldBuilder().addBuilder( index, org.apache.drill.exec.proto.UserBitShared.Jar.getDefaultInstance()); } /**
public org.apache.drill.exec.proto.UserBitShared.Jar.Builder newMessage() { return org.apache.drill.exec.proto.UserBitShared.Jar.newBuilder(); } public java.lang.String getFieldName(int number)
/** * <code>repeated .exec.shared.Jar jar = 1;</code> */ public org.apache.drill.exec.proto.UserBitShared.Jar.Builder addJarBuilder() { return getJarFieldBuilder().addBuilder( org.apache.drill.exec.proto.UserBitShared.Jar.getDefaultInstance()); } /**