public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance()) return this; if (other.hasTableIdentifier()) { mergeTableIdentifier(other.getTableIdentifier()); if (other.hasIfNotExists()) { setIfNotExists(other.getIfNotExists()); this.mergeUnknownFields(other.getUnknownFields()); return this;
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasTableIdentifier()) { hash = (37 * hash) + TABLEIDENTIFIER_FIELD_NUMBER; hash = (53 * hash) + getTableIdentifier().hashCode(); } if (getPartitionDescCount() > 0) { hash = (37 * hash) + PARTITIONDESC_FIELD_NUMBER; hash = (53 * hash) + getPartitionDescList().hashCode(); } if (hasIfNotExists()) { hash = (37 * hash) + IFNOTEXISTS_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getIfNotExists()); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto buildPartial() { org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto result = new org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (tableIdentifierBuilder_ == null) { result.tableIdentifier_ = tableIdentifier_; } else { result.tableIdentifier_ = tableIdentifierBuilder_.build(); } if (partitionDescBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { partitionDesc_ = java.util.Collections.unmodifiableList(partitionDesc_); bitField0_ = (bitField0_ & ~0x00000002); } result.partitionDesc_ = partitionDesc_; } else { result.partitionDesc_ = partitionDescBuilder_.build(); } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000002; } result.ifNotExists_ = ifNotExists_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.NullProto.getDefaultInstance(); case 29: return org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance(); case 30: return org.apache.tajo.catalog.proto.CatalogProtos.PartitionsByAlgebraProto.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.NullProto.getDefaultInstance(); case 28: return org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance(); case 29: return org.apache.tajo.catalog.proto.CatalogProtos.IndexDescProto.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.NullProto.getDefaultInstance(); case 28: return org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance(); case 29: return org.apache.tajo.catalog.proto.CatalogProtos.IndexDescProto.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.NullProto.getDefaultInstance(); case 29: return org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance(); case 30: return org.apache.tajo.catalog.proto.CatalogProtos.PartitionsByAlgebraProto.getDefaultInstance();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto other = (org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto) obj; boolean result = true; result = result && (hasTableIdentifier() == other.hasTableIdentifier()); if (hasTableIdentifier()) { result = result && getTableIdentifier() .equals(other.getTableIdentifier()); } result = result && getPartitionDescList() .equals(other.getPartitionDescList()); result = result && (hasIfNotExists() == other.hasIfNotExists()); if (hasIfNotExists()) { result = result && (getIfNotExists() == other.getIfNotExists()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@Override public void addPartitions(String databaseName, String tableName, List<PartitionDescProto> partitions, boolean ifNotExists) throws UndefinedDatabaseException, UndefinedTableException, DuplicatePartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final AddPartitionsProto.Builder builder = AddPartitionsProto.newBuilder(); final TableIdentifierProto.Builder identifier = TableIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName); builder.setTableIdentifier(identifier.build()); for (PartitionDescProto partition: partitions) { builder.addPartitionDesc(partition); } builder.setIfNotExists(ifNotExists); ReturnState state = stub.addPartitions(null, builder.build()); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, UndefinedPartitionMethodException.class); throwsIfThisError(state, DuplicatePartitionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public void addPartitions(String databaseName, String tableName, List<PartitionDescProto> partitions, boolean ifNotExists) throws UndefinedDatabaseException, UndefinedTableException, DuplicatePartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final AddPartitionsProto.Builder builder = AddPartitionsProto.newBuilder(); final TableIdentifierProto.Builder identifier = TableIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName); builder.setTableIdentifier(identifier.build()); for (PartitionDescProto partition: partitions) { builder.addPartitionDesc(partition); } builder.setIfNotExists(ifNotExists); ReturnState state = stub.addPartitions(null, builder.build()); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, UndefinedPartitionMethodException.class); throwsIfThisError(state, DuplicatePartitionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasTableIdentifier()) { memoizedIsInitialized = 0; return false; } if (!hasIfNotExists()) { memoizedIsInitialized = 0; return false; } if (!getTableIdentifier().isInitialized()) { memoizedIsInitialized = 0; return false; } for (int i = 0; i < getPartitionDescCount(); i++) { if (!getPartitionDesc(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto prototype) {
@Override public ReturnState addPartitions(RpcController controller, AddPartitionsProto request) { TableIdentifierProto identifier = request.getTableIdentifier(); String databaseName = identifier.getDatabaseName(); String tableName = identifier.getTableName(); rlock.lock(); try { store.addPartitions(databaseName, tableName, request.getPartitionDescList(), request.getIfNotExists()); return OK; } catch (Throwable t) { printStackTraceIfError(LOG, t); return returnError(t); } finally { rlock.unlock(); } }
public org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto getDefaultInstanceForType() { return org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto.getDefaultInstance(); }
@Override public ReturnState addPartitions(RpcController controller, AddPartitionsProto request) { TableIdentifierProto identifier = request.getTableIdentifier(); String databaseName = identifier.getDatabaseName(); String tableName = identifier.getTableName(); rlock.lock(); try { store.addPartitions(databaseName, tableName, request.getPartitionDescList(), request.getIfNotExists()); return OK; } catch (Throwable t) { printStackTraceIfError(LOG, t); return returnError(t); } finally { rlock.unlock(); } }
public static Builder newBuilder(org.apache.tajo.catalog.proto.CatalogProtos.AddPartitionsProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, tableIdentifier_); } for (int i = 0; i < partitionDesc_.size(); i++) { output.writeMessage(2, partitionDesc_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBool(3, ifNotExists_); } getUnknownFields().writeTo(output); }