use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class PMetaDataImplTest method testSchema.
@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) {
}
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class SequenceIT method doSetup.
@BeforeClass
@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
public static void doSetup() throws Exception {
Map<String, String> props = getDefaultProps();
// Must update config before starting server
props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, Long.toString(BATCH_SIZE));
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class SpillableGroupByIT method doSetup.
@BeforeClass
public static void doSetup() throws Exception {
Map<String, String> props = Maps.newHashMapWithExpectedSize(11);
// Set a very small cache size to force plenty of spilling
props.put(QueryServices.GROUPBY_MAX_CACHE_SIZE_ATTRIB, Integer.toString(1));
props.put(QueryServices.GROUPBY_SPILLABLE_ATTRIB, String.valueOf(true));
props.put(QueryServices.GROUPBY_SPILL_FILES_ATTRIB, Integer.toString(1));
// Large enough to not run out of memory, but small enough to spill
props.put(QueryServices.MAX_MEMORY_SIZE_ATTRIB, Integer.toString(40000));
// Set guidepost width, but disable stats
props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20));
props.put(QueryServices.STATS_ENABLED_ATTRIB, Boolean.toString(false));
props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB, Boolean.TRUE.toString());
props.put(QueryServices.EXPLAIN_ROW_COUNT_ATTRIB, Boolean.TRUE.toString());
// Must update config before starting server
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class BasePigIT method doSetup.
@BeforeClass
@Shadower(classBeingShadowed = BaseHBaseManagedTimeIT.class)
public static void doSetup() throws Exception {
Map<String, String> props = Maps.newHashMapWithExpectedSize(3);
props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
// Must update config before starting server
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class ConnectionQueryServicesImpl method ensureViewIndexTableDropped.
private boolean ensureViewIndexTableDropped(byte[] physicalTableName, long timestamp) throws SQLException {
byte[] physicalIndexName = MetaDataUtil.getViewIndexPhysicalName(physicalTableName);
boolean wasDeleted = false;
try (HBaseAdmin admin = getAdmin()) {
try {
HTableDescriptor desc = admin.getTableDescriptor(physicalIndexName);
if (Boolean.TRUE.equals(PBoolean.INSTANCE.toObject(desc.getValue(MetaDataUtil.IS_VIEW_INDEX_TABLE_PROP_BYTES)))) {
final ReadOnlyProps props = this.getProps();
final boolean dropMetadata = props.getBoolean(DROP_METADATA_ATTRIB, DEFAULT_DROP_METADATA);
if (dropMetadata) {
admin.disableTable(physicalIndexName);
admin.deleteTable(physicalIndexName);
clearTableRegionCache(physicalIndexName);
wasDeleted = true;
} else {
this.tableStatsCache.invalidateAll(desc);
}
}
} catch (org.apache.hadoop.hbase.TableNotFoundException ignore) {
// Ignore, as we may never have created a view index table
}
} catch (IOException e) {
throw ServerUtil.parseServerException(e);
}
return wasDeleted;
}
Aggregations