/** * Sets PartitionTimeline implementation class's name and specific params in table param. * * @param table * @see #init(org.apache.hadoop.hive.ql.metadata.Table) */ public void updateTableParams(Table table) { String prefix = MetastoreUtil.getPartitionInfoKeyPrefix(getUpdatePeriod(), getPartCol()); String storageClass = MetastoreUtil.getPartitionTimelineStorageClassKey(getUpdatePeriod(), getPartCol()); table.getParameters().put(storageClass, this.getClass().getCanonicalName()); for (Map.Entry<String, String> entry : toProperties().entrySet()) { table.getParameters().put(prefix + entry .getKey(), entry.getValue()); } }
/** * Sets PartitionTimeline implementation class's name and specific params in table param. * * @param table * @see #init(org.apache.hadoop.hive.ql.metadata.Table) */ public void updateTableParams(Table table) { String prefix = MetastoreUtil.getPartitionInfoKeyPrefix(getUpdatePeriod(), getPartCol()); String storageClass = MetastoreUtil.getPartitionTimelineStorageClassKey(getUpdatePeriod(), getPartCol()); table.getParameters().put(storageClass, this.getClass().getCanonicalName()); for (Map.Entry<String, String> entry : toProperties().entrySet()) { table.getParameters().put(prefix + entry .getKey(), entry.getValue()); } }
T inst2 = getInstance(clz, period); Map<String, String> props = inst1.toProperties(); assertTrue(inst2.initFromProperties(props)); assertFalse(inst1.equals(inst2)); assertTrue(inst2.initFromProperties(inst1.toProperties())); assertEquals(inst1, inst2); inst2.initFromProperties(inst1.toProperties()); assertTrue(inst2.isConsistent()); assertEquals(inst1, inst2);