/** * Returns the acidOperationalProperties for a given set of properties. * @param props A properties object * @return the acidOperationalProperties object for the corresponding properties. */ public static AcidOperationalProperties getAcidOperationalProperties(Properties props) { String resultStr = props.getProperty(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (resultStr == null) { // If the properties does not define any transactional properties, we return a default type. return AcidOperationalProperties.getDefault(); } return AcidOperationalProperties.parseString(resultStr); }
/** * Returns the acidOperationalProperties for a given map. * @param parameters A parameters object * @return the acidOperationalProperties object for the corresponding map. */ public static AcidOperationalProperties getAcidOperationalProperties( Map<String, String> parameters) { String resultStr = parameters.get(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (resultStr == null) { // If the parameters does not define any transactional properties, we return a default type. return AcidOperationalProperties.getDefault(); } return AcidOperationalProperties.parseString(resultStr); } /**
/** * Returns the acidOperationalProperties for a given set of properties. * @param props A properties object * @return the acidOperationalProperties object for the corresponding properties. */ public static AcidOperationalProperties getAcidOperationalProperties(Properties props) { String resultStr = props.getProperty(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (resultStr == null) { // If the properties does not define any transactional properties, we return a legacy type. return AcidOperationalProperties.getLegacy(); } return AcidOperationalProperties.parseString(resultStr); }
String transactionalProperties = conf.get(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); this.acidOperationalProperties = isTableTransactional ? AcidOperationalProperties.parseString(transactionalProperties) : null;
String txnProperties = conf.get(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); this.acidOperationalProperties = isTxnTable ? AcidOperationalProperties.parseString(txnProperties) : null;
/** * Returns the acidOperationalProperties for a given map. * @param parameters A parameters object * @return the acidOperationalProperties object for the corresponding map. */ public static AcidOperationalProperties getAcidOperationalProperties( Map<String, String> parameters) { String resultStr = parameters.get(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (resultStr == null) { // If the parameters does not define any transactional properties, we return a legacy type. return AcidOperationalProperties.getLegacy(); } return AcidOperationalProperties.parseString(resultStr); } }
/** * Returns the acidOperationalProperties for a given table. * @param table A table object * @return the acidOperationalProperties object for the corresponding table. */ public static AcidOperationalProperties getAcidOperationalProperties(Table table) { String transactionalProperties = table.getProperty( hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (transactionalProperties == null) { // If the table does not define any transactional properties, we return a legacy type. return AcidOperationalProperties.getLegacy(); } return AcidOperationalProperties.parseString(transactionalProperties); }
/** * Returns the acidOperationalProperties for a given table. * @param table A table object * @return the acidOperationalProperties object for the corresponding table. */ public static AcidOperationalProperties getAcidOperationalProperties(Table table) { String transactionalProperties = table.getProperty( hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES); if (transactionalProperties == null) { // If the table does not define any transactional properties, we return a default type. return AcidOperationalProperties.getDefault(); } return AcidOperationalProperties.parseString(transactionalProperties); }
@Test public void testAcidOperationalProperties() throws Exception { AcidUtils.AcidOperationalProperties testObj = AcidUtils.AcidOperationalProperties.getDefault(); assertsForAcidOperationalProperties(testObj, "default"); testObj = AcidUtils.AcidOperationalProperties.parseInt(1); assertsForAcidOperationalProperties(testObj, "split_update"); testObj = AcidUtils.AcidOperationalProperties.parseString("default"); assertsForAcidOperationalProperties(testObj, "default"); }