@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 (hasTable()) { hash = (37 * hash) + TABLE_FIELD_NUMBER; hash = (53 * hash) + getTable().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@Override public final TableDesc getTableDesc(final String databaseName, final String tableName) throws UndefinedTableException { try { final BlockingInterface stub = getStub(); final TableIdentifierProto request = buildTableIdentifier(databaseName, tableName); final TableResponse response = stub.getTableDesc(null, request); throwsIfThisError(response.getState(), UndefinedTableException.class); ensureOk(response.getState()); return CatalogUtil.newTableDesc(response.getTable()); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final TableDesc getTableDesc(final String databaseName, final String tableName) throws UndefinedTableException { try { final BlockingInterface stub = getStub(); final TableIdentifierProto request = buildTableIdentifier(databaseName, tableName); final TableResponse response = stub.getTableDesc(null, request); throwsIfThisError(response.getState(), UndefinedTableException.class); ensureOk(response.getState()); return CatalogUtil.newTableDesc(response.getTable()); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public TableDesc createExternalTable(final String tableName, @Nullable final Schema schema, final URI path, final TableMeta meta, final PartitionMethodDesc partitionMethodDesc) throws DuplicateTableException, InsufficientPrivilegeException, UnavailableTableLocationException { final NettyClientBase client = conn.getTajoMasterConnection(); conn.checkSessionAndGet(client); final BlockingInterface tajoMasterService = client.getStub(); final ClientProtos.CreateTableRequest.Builder builder = ClientProtos.CreateTableRequest.newBuilder(); builder.setSessionId(conn.sessionId); builder.setName(tableName); if (schema != null) { builder.setSchema(schema.getProto()); } builder.setMeta(meta.getProto()); builder.setPath(path.toString()); if (partitionMethodDesc != null) { builder.setPartition(partitionMethodDesc.getProto()); } TableResponse res; try { res = tajoMasterService.createExternalTable(null, builder.build()); } catch (ServiceException e) { throw new RuntimeException(e); } throwsIfThisError(res.getState(), DuplicateTableException.class); throwsIfThisError(res.getState(), InsufficientPrivilegeException.class); throwsIfThisError(res.getState(), UnavailableTableLocationException.class); ensureOk(res.getState()); return new TableDesc(res.getTable()); }
@Override public TableDesc createExternalTable(final String tableName, @Nullable final Schema schema, final URI path, final TableMeta meta, final PartitionMethodDesc partitionMethodDesc) throws DuplicateTableException, InsufficientPrivilegeException, UnavailableTableLocationException { final NettyClientBase client = conn.getTajoMasterConnection(); conn.checkSessionAndGet(client); final BlockingInterface tajoMasterService = client.getStub(); final ClientProtos.CreateTableRequest.Builder builder = ClientProtos.CreateTableRequest.newBuilder(); builder.setSessionId(conn.sessionId); builder.setName(tableName); if (schema != null) { builder.setSchema(schema.getProto()); } builder.setMeta(meta.getProto()); builder.setPath(path.toString()); if (partitionMethodDesc != null) { builder.setPartition(partitionMethodDesc.getProto()); } TableResponse res; try { res = tajoMasterService.createExternalTable(null, builder.build()); } catch (ServiceException e) { throw new RuntimeException(e); } throwsIfThisError(res.getState(), DuplicateTableException.class); throwsIfThisError(res.getState(), InsufficientPrivilegeException.class); throwsIfThisError(res.getState(), UnavailableTableLocationException.class); ensureOk(res.getState()); return new TableDesc(res.getTable()); }
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; } if (hasTable()) { if (!getTable().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
@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.TableResponse)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.TableResponse other = (org.apache.tajo.catalog.proto.CatalogProtos.TableResponse) obj; boolean result = true; result = result && (hasState() == other.hasState()); if (hasState()) { result = result && getState() .equals(other.getState()); } result = result && (hasTable() == other.hasTable()); if (hasTable()) { result = result && getTable() .equals(other.getTable()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@Override public TableDesc getTableDesc(final String tableName) throws UndefinedTableException { final BlockingInterface stub = conn.getTMStub(); TableResponse res; try { res = stub.getTableDesc(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } if (isThisError(res.getState(), ResultCode.UNDEFINED_TABLE)) { throw new UndefinedTableException(res.getState()); } ensureOk(res.getState()); return new TableDesc(res.getTable()); }
@Override public TableDesc getTableDesc(final String tableName) throws UndefinedTableException { final BlockingInterface stub = conn.getTMStub(); TableResponse res; try { res = stub.getTableDesc(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } if (isThisError(res.getState(), ResultCode.UNDEFINED_TABLE)) { throw new UndefinedTableException(res.getState()); } ensureOk(res.getState()); return new TableDesc(res.getTable()); }
public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.TableResponse other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.TableResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasTable()) { mergeTable(other.getTable()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }