return new Path(directory, String.format(LEGACY_FILE_BUCKET_DIGITS, options.getBucketId()) + "_0"); } else if (options.isWritingBase()) { subdir = BASE_PREFIX + String.format(DELTA_DIGITS, options.getMaximumWriteId());
return new Path(directory, String.format(LEGACY_FILE_BUCKET_DIGITS, options.getBucket()) + "_0"); } else if (options.isWritingBase()) { subdir = BASE_PREFIX + String.format(DELTA_DIGITS, options.getMaximumTransactionId());
&& !options.isWritingBase()){ flushLengths = fs.create(OrcAcidUtils.getSideFile(this.path), true, 8, options.getReporter()); if (options.isWritingBase()) { if (options instanceof OrcOptions) { writerOptions = ((OrcOptions) options).getOrcOptions();
&& !options.isWritingBase()){ flushLengths = fs.create(getSideFile(this.path), true, 8, options.getReporter()); if (!options.isWritingBase()) { writerOptions.blockPadding(false); writerOptions.bufferSize(DELTA_BUFFER_SIZE);
final OrcFile.WriterOptions opts = OrcFile.writerOptions(options.getConfiguration()); if (!options.isWritingBase()) { opts.bufferSize(OrcRecordUpdater.DELTA_BUFFER_SIZE) .stripeSize(OrcRecordUpdater.DELTA_STRIPE_SIZE)
/** * Create a filename for a bucket file. * @param directory the partition directory * @param options the options for writing the bucket * @return the filename that should store the bucket */ public static Path createFilename(Path directory, AcidOutputFormat.Options options) { String subdir; if (options.getOldStyle()) { return new Path(directory, String.format(BUCKET_DIGITS, options.getBucket()) + "_0"); } else if (options.isWritingBase()) { subdir = BASE_PREFIX + String.format(DELTA_DIGITS, options.getMaximumTransactionId()); } else { subdir = deltaSubdir(options.getMinimumTransactionId(), options.getMaximumTransactionId()); } return createBucketFile(new Path(directory, subdir), options.getBucket()); }
public static String getOptionsValue(Options options) { StringBuilder content = new StringBuilder(); int bucket = getBucket(options); String inspectorInfo = options.getInspector().getCategory() + ":" + options.getInspector() .getTypeName(); long maxTxnId = options.getMaximumWriteId(); long minTxnId = options.getMinimumWriteId(); int recordIdColumn = options.getRecordIdColumn(); boolean isCompresses = options.isCompressed(); boolean isWritingBase = options.isWritingBase(); content.append("bucket : ").append(bucket).append(", inspectorInfo : ").append (inspectorInfo).append(", minTxnId : ").append(minTxnId).append(", maxTxnId : ") .append(maxTxnId).append(", recordIdColumn : ").append(recordIdColumn); content.append(", isCompressed : ").append(isCompresses).append(", isWritingBase : ") .append(isWritingBase); return content.toString(); }
if (options.getMinimumWriteId() != options.getMaximumWriteId() && !options.isWritingBase()) { if (options.isWritingBase()) { if (options instanceof OrcOptions) { writerOptions = ((OrcOptions) options).getOrcOptions();
final OrcFile.WriterOptions opts = OrcFile.writerOptions(options.getConfiguration()); if (!options.isWritingBase()) { opts.bufferSize(OrcRecordUpdater.DELTA_BUFFER_SIZE) .stripeSize(OrcRecordUpdater.DELTA_STRIPE_SIZE)
final OrcFile.WriterOptions opts = OrcFile.writerOptions(options.getTableProperties(), options.getConfiguration()); if (!options.isWritingBase()) { opts.bufferSize(OrcRecordUpdater.DELTA_BUFFER_SIZE) .stripeSize(OrcRecordUpdater.DELTA_STRIPE_SIZE)
conf); assertEquals(false, opts.getOldStyle()); assertEquals(true, opts.isWritingBase()); assertEquals(567, opts.getMaximumWriteId()); assertEquals(0, opts.getMinimumWriteId()); new MockPath(fs, dir + "/delta_000005_000006/bucket_00001"), conf); assertEquals(false, opts.getOldStyle()); assertEquals(false, opts.isWritingBase()); assertEquals(6, opts.getMaximumWriteId()); assertEquals(5, opts.getMinimumWriteId()); new MockPath(fs, dir + "/delete_delta_000005_000006/bucket_00001"), conf); assertEquals(false, opts.getOldStyle()); assertEquals(false, opts.isWritingBase()); assertEquals(6, opts.getMaximumWriteId()); assertEquals(5, opts.getMinimumWriteId()); opts = AcidUtils.parseBaseOrDeltaBucketFilename(new Path(dir, "000123_0"), conf); assertEquals(true, opts.getOldStyle()); assertEquals(true, opts.isWritingBase()); assertEquals(123, opts.getBucketId()); assertEquals(0, opts.getMinimumWriteId());