@Override public Repo<Master> call(long tid, Master master) throws Exception { final Path bulkDir = new Path(bulkInfo.bulkDir); final Path sourceDir = new Path(bulkInfo.sourceDir); log.debug(" tid {} sourceDir {}", tid, sourceDir); VolumeManager fs = master.getFileSystem(); if (bulkInfo.tableState == TableState.ONLINE) { ZooArbitrator.start(master.getContext(), Constants.BULK_ARBITRATOR_TYPE, tid); } try { Map<String,String> oldToNewNameMap = BulkSerialize.readRenameMap(bulkDir.toString(), p -> fs.open(p)); moveFiles(String.format("%016x", tid), sourceDir, bulkDir, master, fs, oldToNewNameMap); return new LoadFiles(bulkInfo); } catch (Exception ex) { throw new AcceptableThriftTableOperationException(bulkInfo.tableId.canonicalID(), null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_INPUT_DIRECTORY, bulkInfo.sourceDir + ": " + ex); } }
errorDir + " is not empty"); ZooArbitrator.start(master.getContext(), Constants.BULK_ARBITRATOR_TYPE, tid); master.updateBulkImportStatus(sourceDir, BulkImportState.MOVING);
+ " is not empty"); ZooArbitrator.start(Constants.BULK_ARBITRATOR_TYPE, tid);
TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir + " is not empty"); ZooArbitrator.start(Constants.BULK_ARBITRATOR_TYPE, tid); master.updateBulkImportStatus(sourceDir, BulkImportState.MOVING);
private void runSplitRecoveryTest(AccumuloServerContext context, int failPoint, String mr, int extentToSplit, ZooLock zl, KeyExtent... extents) throws Exception { Text midRow = new Text(mr); SortedMap<FileRef,DataFileValue> splitMapFiles = null; for (int i = 0; i < extents.length; i++) { KeyExtent extent = extents[i]; String tdir = ServerConstants.getTablesDirs()[0] + "/" + extent.getTableId() + "/dir_" + i; MetadataTableUtil.addTablet(extent, tdir, context, TabletTime.LOGICAL_TIME_ID, zl); SortedMap<FileRef,DataFileValue> mapFiles = new TreeMap<>(); mapFiles.put(new FileRef(tdir + "/" + RFile.EXTENSION + "_000_000"), new DataFileValue(1000017 + i, 10000 + i)); if (i == extentToSplit) { splitMapFiles = mapFiles; } int tid = 0; TransactionWatcher.ZooArbitrator.start(Constants.BULK_ARBITRATOR_TYPE, tid); MetadataTableUtil.updateTabletDataFile(tid, extent, mapFiles, "L0", context, zl); } KeyExtent extent = extents[extentToSplit]; KeyExtent high = new KeyExtent(extent.getTableId(), extent.getEndRow(), midRow); KeyExtent low = new KeyExtent(extent.getTableId(), midRow, extent.getPrevEndRow()); splitPartiallyAndRecover(context, extent, high, low, .4, splitMapFiles, midRow, "localhost:1234", failPoint, zl); }