public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); 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 (hasState()) { hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + getState().hashCode(); } if (getIndexDescCount() > 0) { hash = (37 * hash) + INDEXDESC_FIELD_NUMBER; hash = (53 * hash) + getIndexDescList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@Override public IndexListResponse getAllIndexes(RpcController controller, NullProto request) throws ServiceException { rlock.lock(); try { return IndexListResponse.newBuilder().setState(OK).addAllIndexDesc(store.getAllIndexes()).build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return IndexListResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }
return org.apache.tajo.catalog.proto.CatalogProtos.IndexResponse.getDefaultInstance(); case 38: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 39: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 40: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.catalog.proto.CatalogProtos.IndexResponse.getDefaultInstance(); case 38: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 39: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 40: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.catalog.proto.CatalogProtos.IndexResponse.getDefaultInstance(); case 36: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 37: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 38: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.catalog.proto.CatalogProtos.IndexResponse.getDefaultInstance(); case 36: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 37: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 38: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance(); case 32: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 33: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance(); case 32: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 33: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance(); case 32: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 33: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance(); case 32: return org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse.getDefaultInstance(); case 33: return org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState.getDefaultInstance();
return IndexListResponse.newBuilder().setState(OK).build(); return IndexListResponse.newBuilder().setState(returnError(t)).build(); return IndexListResponse.newBuilder() .setState(errUndefinedIndex(tableName)) .build(); IndexListResponse.Builder builder = IndexListResponse.newBuilder().setState(OK); for (String eachIndexName : store.getAllIndexNamesByTable(databaseName, tableName)) { builder.addIndexDesc(store.getIndexByName(databaseName, eachIndexName)); printStackTraceIfError(LOG, t); return IndexListResponse.newBuilder() .setState(returnError(t)) .build();
return IndexListResponse.newBuilder().setState(OK).build(); return IndexListResponse.newBuilder().setState(returnError(t)).build(); return IndexListResponse.newBuilder() .setState(errUndefinedIndex(tableName)) .build(); IndexListResponse.Builder builder = IndexListResponse.newBuilder().setState(OK); for (String eachIndexName : store.getAllIndexNamesByTable(databaseName, tableName)) { builder.addIndexDesc(store.getIndexByName(databaseName, eachIndexName)); printStackTraceIfError(LOG, t); return IndexListResponse.newBuilder() .setState(returnError(t)) .build();
@Override public IndexListResponse getIndexesForTable(RpcController controller, SessionedStringProto request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); Session session = context.getSessionManager().getSession(request.getSessionId().getId()); String tableName, databaseName; if (IdentifierUtil.isFQTableName(request.getValue())) { String [] splitted = IdentifierUtil.splitFQTableName(request.getValue()); databaseName = splitted[0]; tableName = splitted[1]; } else { databaseName = session.getCurrentDatabase(); tableName = request.getValue(); } IndexListResponse.Builder builder = IndexListResponse.newBuilder().setState(OK); for (IndexDesc index : catalog.getAllIndexesByTable(databaseName, tableName)) { builder.addIndexDesc(index.getProto()); } return builder.build(); } catch (Throwable t) { return IndexListResponse.newBuilder() .setState(returnError(t)) .build(); } }
@Override public IndexListResponse getIndexesForTable(RpcController controller, SessionedStringProto request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); Session session = context.getSessionManager().getSession(request.getSessionId().getId()); String tableName, databaseName; if (CatalogUtil.isFQTableName(request.getValue())) { String [] splitted = CatalogUtil.splitFQTableName(request.getValue()); databaseName = splitted[0]; tableName = splitted[1]; } else { databaseName = session.getCurrentDatabase(); tableName = request.getValue(); } IndexListResponse.Builder builder = IndexListResponse.newBuilder().setState(OK); for (IndexDesc index : catalog.getAllIndexesByTable(databaseName, tableName)) { builder.addIndexDesc(index.getProto()); } return builder.build(); } catch (Throwable t) { return IndexListResponse.newBuilder() .setState(returnError(t)) .build(); } }
public org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse buildPartial() { org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse result = new org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (stateBuilder_ == null) { result.state_ = state_; } else { result.state_ = stateBuilder_.build(); } if (indexDescBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { indexDesc_ = java.util.Collections.unmodifiableList(indexDesc_); bitField0_ = (bitField0_ & ~0x00000002); } result.indexDesc_ = indexDesc_; } else { result.indexDesc_ = indexDescBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@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.IndexListResponse)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse other = (org.apache.tajo.catalog.proto.CatalogProtos.IndexListResponse) obj; boolean result = true; result = result && (hasState() == other.hasState()); if (hasState()) { result = result && getState() .equals(other.getState()); } result = result && getIndexDescList() .equals(other.getIndexDescList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasState()) { memoizedIsInitialized = 0; return false; } if (!getState().isInitialized()) { memoizedIsInitialized = 0; return false; } for (int i = 0; i < getIndexDescCount(); i++) { if (!getIndexDesc(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
@Override public final Collection<IndexDesc> getAllIndexesByTable(final String databaseName, final String tableName) { try { TableIdentifierProto proto = CatalogUtil.buildTableIdentifier(databaseName, tableName); final BlockingInterface stub = getStub(); final IndexListResponse response = stub.getAllIndexesByTable(null, proto); ensureOk(response.getState()); List<IndexDesc> indexDescs = TUtil.newList(); for (IndexDescProto descProto : response.getIndexDescList()) { indexDescs.add(new IndexDesc(descProto)); } return indexDescs; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final Collection<IndexDesc> getAllIndexesByTable(final String databaseName, final String tableName) { try { TableIdentifierProto proto = CatalogUtil.buildTableIdentifier(databaseName, tableName); final BlockingInterface stub = getStub(); final IndexListResponse response = stub.getAllIndexesByTable(null, proto); ensureOk(response.getState()); List<IndexDesc> indexDescs = new ArrayList<>(); for (IndexDescProto descProto : response.getIndexDescList()) { indexDescs.add(new IndexDesc(descProto)); } return indexDescs; } catch (ServiceException e) { throw new RuntimeException(e); } }