private List<Tuple> getIndexes(Schema outSchema) { List<IndexDescProto> indexList = masterContext.getCatalog().getAllIndexes(); List<Tuple> tuples = new ArrayList<>(indexList.size()); List<Column> columns = outSchema.getRootColumns(); Tuple aTuple; for (IndexDescProto index: indexList) { aTuple = new VTuple(outSchema.size()); for (int fieldId = 0; fieldId < columns.size(); fieldId++) { Column column = columns.get(fieldId); if ("db_id".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createInt4(index.getTableIdentifier().getDbId())); } else if ("tid".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createInt4(index.getTableIdentifier().getTid())); } else if ("index_name".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexName())); } else if ("index_method".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexMethod().name())); } else if ("index_path".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexPath())); } } tuples.add(aTuple); } return tuples; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasDatabaseName()) { hash = (37 * hash) + DATABASE_NAME_FIELD_NUMBER; hash = (53 * hash) + getDatabaseName().hashCode(); } if (hasTableName()) { hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; hash = (53 * hash) + getTableName().hashCode(); } if (hasDbId()) { hash = (37 * hash) + DBID_FIELD_NUMBER; hash = (53 * hash) + getDbId(); } if (hasTid()) { hash = (37 * hash) + TID_FIELD_NUMBER; hash = (53 * hash) + getTid(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
private List<Tuple> getIndexes(Schema outSchema) { List<IndexDescProto> indexList = masterContext.getCatalog().getAllIndexes(); List<Tuple> tuples = new ArrayList<Tuple>(indexList.size()); List<Column> columns = outSchema.getRootColumns(); Tuple aTuple; for (IndexDescProto index: indexList) { aTuple = new VTuple(outSchema.size()); for (int fieldId = 0; fieldId < columns.size(); fieldId++) { Column column = columns.get(fieldId); if ("db_id".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createInt4(index.getTableIdentifier().getDbId())); } else if ("tid".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createInt4(index.getTableIdentifier().getTid())); } else if ("index_name".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexName())); } else if ("index_method".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexMethod().name())); } else if ("index_path".equalsIgnoreCase(column.getSimpleName())) { aTuple.put(fieldId, DatumFactory.createText(index.getIndexPath())); } } tuples.add(aTuple); } return tuples; }
public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.TableIdentifierProto other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.TableIdentifierProto.getDefaultInstance()) return this; if (other.hasDatabaseName()) { bitField0_ |= 0x00000001; databaseName_ = other.databaseName_; onChanged(); } if (other.hasTableName()) { bitField0_ |= 0x00000002; tableName_ = other.tableName_; onChanged(); } if (other.hasDbId()) { setDbId(other.getDbId()); } if (other.hasTid()) { setTid(other.getTid()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }