private static PSchema newDeletedSchemaMarker(long timestamp) { return new PSchema(timestamp); }
private static Map<PTableKey, PSchema> cloneSchemaMap(Map<PTableKey, PSchema> schemas, int expectedCapacity) { Map<PTableKey, PSchema> newSchemas = newSchemaMap(Math.max(schemas.size(), expectedCapacity)); // Copy value so that access time isn't changing anymore for (PSchema schema : schemas.values()) { newSchemas.put(schema.getSchemaKey(), new PSchema(schema)); } return newSchemas; }
public SingleTableColumnResolver(PhoenixConnection connection, TableRef tableRef) { super(connection, 0, null); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(TableRef tableRef) throws SQLException { super(null, 0, null); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(PhoenixConnection connection, TableRef tableRef, Map<String, UDFParseNode> udfParseNodes, TableName mutatingTableName) throws SQLException { super(connection, 0, false, udfParseNodes, mutatingTableName); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public static PSchema createFromProto(PSchemaProtos.PSchema schema) { long timeStamp = schema.getTimeStamp(); String schemaName = schema.getSchemaName(); return new PSchema(schemaName, timeStamp); }
public SingleTableColumnResolver(PhoenixConnection connection, NamedTableNode tableNode, boolean updateCacheImmediately, int tsAddition, Map<String, UDFParseNode> udfParseNodes, boolean alwaysHitServer, TableName mutatingTableName) throws SQLException { super(connection, tsAddition, updateCacheImmediately, udfParseNodes, mutatingTableName); alias = tableNode.getAlias(); TableRef tableRef = createTableRef(tableNode.getName().getSchemaName(), tableNode, updateCacheImmediately, alwaysHitServer); PSchema schema = new PSchema(tableRef.getTable().getSchemaName().toString()); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(schema); }
private PSchema getSchema(RegionScanner scanner, long clientTimeStamp) throws IOException, SQLException { List<Cell> results = Lists.newArrayList(); scanner.next(results); if (results.isEmpty()) { return null; } Cell keyValue = results.get(0); byte[] keyBuffer = keyValue.getRowArray(); int keyLength = keyValue.getRowLength(); int keyOffset = keyValue.getRowOffset(); PName tenantId = newPName(keyBuffer, keyOffset, keyLength); int tenantIdLength = (tenantId == null) ? 0 : tenantId.getBytes().length; if (tenantIdLength == 0) { tenantId = null; } PName schemaName = newPName(keyBuffer, keyOffset + tenantIdLength + 1, keyLength - tenantIdLength - 1); long timeStamp = keyValue.getTimestamp(); return new PSchema(schemaName.getString(), timeStamp); }
alias = null; tableRefs = ImmutableList.of(new TableRef(alias, theTable, timeStamp, !table.getDynamicColumns().isEmpty())); schemas = ImmutableList.of(new PSchema(theTable.getSchemaName().toString(), timeStamp));
boolean wasAutoCommit = connection.getAutoCommit(); try { PSchema schema = new PSchema(executableDropSchemaStatement.getSchemaName()); String schemaName = schema.getSchemaName(); boolean ifExists = executableDropSchemaStatement.ifExists();
boolean isIfNotExists = create.isIfNotExists(); validateSchema(create.getSchemaName()); PSchema schema = new PSchema(create.getSchemaName()); connection.setAutoCommit(false); List<Mutation> schemaMutations;
private static Map<PTableKey, PSchema> cloneSchemaMap(Map<PTableKey, PSchema> schemas, int expectedCapacity) { Map<PTableKey, PSchema> newSchemas = newSchemaMap(Math.max(schemas.size(), expectedCapacity)); // Copy value so that access time isn't changing anymore for (PSchema schema : schemas.values()) { newSchemas.put(schema.getSchemaKey(), new PSchema(schema)); } return newSchemas; }
private static Map<PTableKey, PSchema> cloneSchemaMap(Map<PTableKey, PSchema> schemas, int expectedCapacity) { Map<PTableKey, PSchema> newSchemas = newSchemaMap(Math.max(schemas.size(), expectedCapacity)); // Copy value so that access time isn't changing anymore for (PSchema schema : schemas.values()) { newSchemas.put(schema.getSchemaKey(), new PSchema(schema)); } return newSchemas; }
public SingleTableColumnResolver(TableRef tableRef) throws SQLException { super(null, 0, null); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(PhoenixConnection connection, TableRef tableRef, Map<String, UDFParseNode> udfParseNodes, TableName mutatingTableName) throws SQLException { super(connection, 0, false, udfParseNodes, mutatingTableName); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(PhoenixConnection connection, TableRef tableRef) { super(connection, 0, null); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(PhoenixConnection connection, TableRef tableRef, Map<String, UDFParseNode> udfParseNodes, TableName mutatingTableName) throws SQLException { super(connection, 0, false, udfParseNodes, mutatingTableName); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public SingleTableColumnResolver(TableRef tableRef) throws SQLException { super(null, 0, null); alias = tableRef.getTableAlias(); tableRefs = ImmutableList.of(tableRef); schemas = ImmutableList.of(new PSchema(tableRef.getTable().getSchemaName().toString())); }
public static PSchema createFromProto(PSchemaProtos.PSchema schema) { long timeStamp = schema.getTimeStamp(); String schemaName = schema.getSchemaName(); return new PSchema(schemaName, timeStamp); }
@Test public void testSchema() throws Exception { TestTimeKeeper timeKeeper = new TestTimeKeeper(); PMetaData metaData = new PMetaDataImpl(5, timeKeeper, new ReadOnlyProps(Collections.EMPTY_MAP)); PSchema schema = new PSchema("testSchema"); metaData.addSchema(schema); assertEquals(schema, metaData.getSchema(schema.getSchemaKey())); metaData.removeSchema(schema, schema.getTimeStamp()); try { metaData.getSchema(schema.getSchemaKey()); fail("the schema should be removed"); } catch (SchemaNotFoundException e) { } }