org.apache.hadoop.hive.metastore.api.Table.setWriteId()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.setWriteId()方法的一些代码示例,展示了Table.setWriteId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setWriteId()方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:setWriteId

Table.setWriteId介绍

暂无

代码示例

代码示例来源:origin: apache/hive

private static class ThreadLocalHive extends ThreadLocal<Hive> {
 @Override
 protected Hive initialValue() {
  return null;
 }
 @Override
 public synchronized void set(Hive hiveObj) {
  Hive currentHive = this.get();
  if (currentHive != hiveObj) {
   // Remove/close current thread-local Hive object before overwriting with new Hive object.
   remove();
   super.set(hiveObj);
  }
 }
 @Override
 public synchronized void remove() {
  Hive currentHive = this.get();
  if (currentHive != null) {
   // Close the metastore connections before removing it from thread local hiveDB.
   currentHive.close(false);
   super.remove();
  }
 }
}

代码示例来源:origin: apache/hive

table.setWriteId(writeId);

代码示例来源:origin: apache/hive

private void alterTableInternal(boolean wasTxn, Table table,
  org.apache.hadoop.hive.ql.metadata.Table modifiedTable) throws HiveException {
 IMetaStoreClient msc = getMSC();
 TxnCtx txnCtx = generateTxnCtxForAlter(table, msc, wasTxn);
 boolean isOk = false;
 try {
  String validWriteIds = null;
  if (txnCtx != null) {
   validWriteIds = txnCtx.validWriteIds;
   modifiedTable.getTTable().setWriteId(txnCtx.writeId);
  }
  msc.alter_table(table.getCatName(), table.getDbName(), table.getTableName(),
    modifiedTable.getTTable(), null, validWriteIds);
  isOk = true;
 } catch (TException ex) {
  throw new HiveException(ex);
 } finally {
  closeTxnCtx(txnCtx, msc, isOk);
 }
}

代码示例来源:origin: apache/hive

t.setWriteId(request.getWriteId());
StatsSetupConst.clearColumnStatsState(t.getParameters());
StatsSetupConst.setBasicStatsState(t.getParameters(), StatsSetupConst.FALSE);

代码示例来源:origin: apache/hive

newTbl.getTTable().setWriteId(tableSnapshot.getWriteId());
} else {
 LOG.warn("Cannot get a table snapshot for " + tblName);

代码示例来源:origin: apache/hive

t.setRewriteEnabled(mtbl.isRewriteEnabled());
t.setCatName(mtbl.getDatabase().getCatalogName());
t.setWriteId(mtbl.getWriteId());
return t;

代码示例来源:origin: apache/hive

table.setWriteId(writeId);
table.setParameters(newParams);
sharedCache.alterTableInCache(catName, dbName, tblName, table);

代码示例来源:origin: apache/hive

@Test
public void testAlterTable() throws Exception {
 Table originalTable = testTables[2];
 String originalTableName = originalTable.getTableName();
 String originalDatabase = originalTable.getDbName();
 Table newTable = getTableWithAllParametersSet();
 newTable.setTableName(originalTableName);
 newTable.setDbName(originalDatabase);
 // Partition keys can not be set, but getTableWithAllParametersSet is added one, so remove for
 // this test
 newTable.setPartitionKeys(originalTable.getPartitionKeys());
 client.alter_table(originalDatabase, originalTableName, newTable);
 Table alteredTable = client.getTable(originalDatabase, originalTableName);
 // The extra parameters will be added on server side, so check that the required ones are
 // present
 for(String key: newTable.getParameters().keySet()) {
  Assert.assertEquals("parameters are present", newTable.getParameters().get(key),
    alteredTable.getParameters().get(key));
 }
 // The parameters are checked manually, so do not check them
 newTable.setParameters(alteredTable.getParameters());
 // Some of the data is set on the server side, so reset those
 newTable.setCreateTime(alteredTable.getCreateTime());
 newTable.setCreationMetadata(alteredTable.getCreationMetadata());
 newTable.setWriteId(alteredTable.getWriteId());
 Assert.assertTrue(alteredTable.isSetId());
 alteredTable.unsetId();
 Assert.assertEquals("The table data should be the same", newTable, alteredTable);
}

代码示例来源:origin: apache/hive

ft.getTTable().setWriteId(0);
tbl.getTTable().setWriteId(0);

代码示例来源:origin: apache/hive

tbl.setWriteId(badWriteId);
msClient.alter_table(
  null, dbName, tblName, tbl, new EnvironmentContext(), initialWriteIds.toString());
badWriteId = msClient.allocateTableWriteId(badTxnId, dbName, tblName);
tbl = msClient.getTable(dbName, tblName);
tbl.setWriteId(badWriteId);
StatsSetupConst.setBasicStatsState(tbl.getParameters(), StatsSetupConst.FALSE);
msClient.alter_table(null, dbName, tblName, tbl, new EnvironmentContext(), initialWriteIds.toString());

代码示例来源:origin: apache/hive

table.setWriteId(createdTable.getWriteId());

代码示例来源:origin: apache/hive

unsetWriteId();
} else {
 setWriteId((Long)value);

相关文章

Table类方法