protected void addBaseFile(Table t, Partition p, long maxTxn, int numRecords) throws Exception { addFile(t, p, 0, maxTxn, numRecords, FileType.BASE, 2, true); }
protected void burnThroughTransactions(String dbName, String tblName, int num) throws MetaException, NoSuchTxnException, TxnAbortedException { burnThroughTransactions(dbName, tblName, num, null, null); }
protected Partition newPartition(Table t, String value) throws Exception { return newPartition(t, value, null); }
protected Partition newPartition(Table t, String value, List<Order> sortCols) throws Exception { Partition part = new Partition(); part.addToValues(value); part.setDbName(t.getDbName()); part.setTableName(t.getTableName()); part.setSd(newStorageDescriptor(getLocation(t.getTableName(), value), sortCols)); part.setParameters(new HashMap<String, String>()); ms.add_partition(part); return part; }
String makeDeltaDirName(long minTxnId, long maxTxnId) { if(minTxnId != maxTxnId) { //covers both streaming api and post compaction style. return makeDeltaDirNameCompacted(minTxnId, maxTxnId); } return useHive130DeltaDirName() ? AcidUtils.deltaSubdir(minTxnId, maxTxnId, 0) : AcidUtils.deltaSubdir(minTxnId, maxTxnId); } /**
protected void startInitiator() throws Exception { startThread('i', true); }
boolean allBucketsPresent) throws Exception { String partValue = (p == null) ? null : p.getValues().get(0); Path location = new Path(getLocation(t.getTableName(), partValue)); String filename = null; switch (type) { case BASE: filename = "base_" + maxTxn; break; case LENGTH_FILE: // Fall through to delta case DELTA: filename = makeDeltaDirName(minTxn, maxTxn); break; case LEGACY: break; // handled below
protected Table newTable(String dbName, String tableName, boolean partitioned, Map<String, String> parameters) throws TException { return newTable(dbName, tableName, partitioned, parameters, null, false); }
protected List<Path> getDirectories(HiveConf conf, Table t, Partition p) throws Exception { String partValue = (p == null) ? null : p.getValues().get(0); String location = getLocation(t.getTableName(), partValue); Path dir = new Path(location); FileSystem fs = FileSystem.get(conf); FileStatus[] stats = fs.listStatus(dir); List<Path> paths = new ArrayList<Path>(stats.length); for (int i = 0; i < stats.length; i++) paths.add(stats[i].getPath()); return paths; }
table.setDbName(dbName); table.setOwner("me"); table.setSd(newStorageDescriptor(getLocation(tableName, null), sortCols)); List<FieldSchema> partKeys = new ArrayList<FieldSchema>(1); if (partitioned) {
protected void startWorker() throws Exception { startThread('w', true); }
protected Table newTempTable(String tableName) throws TException { return newTable("default", tableName, false, null, null, true); }
protected void addDeltaFile(Table t, Partition p, long minTxn, long maxTxn, int numRecords, int numBuckets, boolean allBucketsPresent) throws Exception { addFile(t, p, minTxn, maxTxn, numRecords, FileType.DELTA, numBuckets, allBucketsPresent); }
protected void startCleaner(AtomicBoolean looped) throws Exception { startThread('c', false, looped); }
protected Table newTable(String dbName, String tableName, boolean partitioned) throws TException { return newTable(dbName, tableName, partitioned, new HashMap<String, String>(), null, false); }
protected void addBaseFile(Table t, Partition p, long maxTxn, int numRecords, int numBuckets, boolean allBucketsPresent) throws Exception { addFile(t, p, 0, maxTxn, numRecords, FileType.BASE, numBuckets, allBucketsPresent); }
protected void startCleaner() throws Exception { startThread('c', true); }
protected void addDeltaFile(Table t, Partition p, long minTxn, long maxTxn, int numRecords) throws Exception { addFile(t, p, minTxn, maxTxn, numRecords, FileType.DELTA, 2, true); }
private void startThread(char type, boolean stopAfterOne) throws Exception { startThread(type, stopAfterOne, new AtomicBoolean()); }
protected void addLengthFile(Table t, Partition p, long minTxn, long maxTxn, int numRecords) throws Exception { addFile(t, p, minTxn, maxTxn, numRecords, FileType.LENGTH_FILE, 2, true); }