public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
result = result && (hasRecursive() == other.hasRecursive()); if (hasRecursive()) { result = result && (getRecursive() == other.getRecursive()); result = result && (hasAlluxioOnly() == other.hasAlluxioOnly()); if (hasAlluxioOnly()) { result = result && (getAlluxioOnly() == other.getAlluxioOnly()); result = result && (hasUnchecked() == other.hasUnchecked()); if (hasUnchecked()) { result = result && (getUnchecked() == other.getUnchecked()); result = result && (hasCommonOptions() == other.hasCommonOptions()); if (hasCommonOptions()) { result = result && getCommonOptions() .equals(other.getCommonOptions());
/** * <code>optional .alluxio.grpc.file.DeletePOptions options = 2;</code> */ public Builder mergeOptions(alluxio.grpc.DeletePOptions value) { if (optionsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && options_ != null && options_ != alluxio.grpc.DeletePOptions.getDefaultInstance()) { options_ = alluxio.grpc.DeletePOptions.newBuilder(options_).mergeFrom(value).buildPartial(); } else { options_ = value; } onChanged(); } else { optionsBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
@Test public void deleteOptionsDefaults() { DeletePOptions options = FileSystemMasterOptions.deleteDefaults(); Assert.assertNotNull(options); Assert.assertFalse(options.getRecursive()); Assert.assertFalse(options.getAlluxioOnly()); Assert.assertFalse(options.getUnchecked()); }
/** * Creates a new instance of {@link SafeUfsDeleter}. * * @param mountTable the mount table * @param inodeStore the inode store * @param inodes sub-tree being deleted (any node should appear before descendants) * @param deleteOptions delete options */ public SafeUfsDeleter(MountTable mountTable, ReadOnlyInodeStore inodeStore, List<Pair<AlluxioURI, LockedInodePath>> inodes, DeletePOptions deleteOptions) throws IOException, FileDoesNotExistException, InvalidPathException { mMountTable = mountTable; // Root of sub-tree occurs before any of its descendants mRootPath = inodes.get(0).getFirst(); if (!deleteOptions.getUnchecked() && !deleteOptions.getAlluxioOnly()) { mUfsSyncChecker = new UfsSyncChecker(mMountTable, inodeStore); for (Pair<AlluxioURI, LockedInodePath> inodePair : inodes) { AlluxioURI alluxioUri = inodePair.getFirst(); Inode inode = inodePair.getSecond().getInodeOrNull(); // Mount points are not deleted recursively as we need to preserve the directory itself if (inode != null && inode.isPersisted() && inode.isDirectory() && !mMountTable.isMountPoint(alluxioUri)) { mUfsSyncChecker.checkDirectory(inode.asDirectory(), alluxioUri); } } } }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(alluxio.grpc.DeletePOptions prototype) {
/** * <code>optional .alluxio.grpc.file.DeletePOptions options = 2;</code> */ public alluxio.grpc.DeletePOptionsOrBuilder getOptionsOrBuilder() { return options_ == null ? alluxio.grpc.DeletePOptions.getDefaultInstance() : options_; }
public static Builder newBuilder(alluxio.grpc.DeletePOptions prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
/** * <code>optional .alluxio.grpc.file.DeletePOptions options = 2;</code> */ public alluxio.grpc.DeletePOptions getOptions() { return options_ == null ? alluxio.grpc.DeletePOptions.getDefaultInstance() : options_; } /**
DeletePOptions deleteOptions = DeletePOptions.newBuilder().setAlluxioOnly(true).build(); mFileSystem.delete(inconsistentUri, deleteOptions); mFileSystem.exists(inconsistentUri); DeletePOptions.newBuilder().setAlluxioOnly(true).setRecursive(true).build(); System.out.println("repairing path: " + uri); mFileSystem.delete(uri, deleteOptions);
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasRecursive()) { hash = (37 * hash) + RECURSIVE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getRecursive()); } if (hasAlluxioOnly()) { hash = (37 * hash) + ALLUXIOONLY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getAlluxioOnly()); } if (hasUnchecked()) { hash = (37 * hash) + UNCHECKED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getUnchecked()); } if (hasCommonOptions()) { hash = (37 * hash) + COMMONOPTIONS_FIELD_NUMBER; hash = (53 * hash) + getCommonOptions().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * @return the instance of {@link DeleteContext} with default values for master */ public static DeleteContext defaults() { DeletePOptions masterOptions = FileSystemMasterOptions.deleteDefaults(); return new DeleteContext(masterOptions.toBuilder()); }
public alluxio.grpc.DeletePOptions getDefaultInstanceForType() { return alluxio.grpc.DeletePOptions.getDefaultInstance(); }
/** * Attempts to delete the file or directory with the specified path. * * @param path path to delete * @param recursive if true, will attempt to delete all children of the path * @return true if one or more files/directories were deleted; false otherwise */ @Override public boolean delete(Path path, boolean recursive) throws IOException { LOG.debug("delete({}, {})", path, recursive); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); DeletePOptions options = DeletePOptions.newBuilder().setRecursive(recursive).build(); try { mFileSystem.delete(uri, options); return true; } catch (InvalidPathException | FileDoesNotExistException e) { LOG.warn("delete failed: {}", e.getMessage()); return false; } catch (AlluxioException e) { throw new IOException(e); } }
public Builder mergeFrom(alluxio.grpc.DeletePOptions other) { if (other == alluxio.grpc.DeletePOptions.getDefaultInstance()) return this; if (other.hasRecursive()) { setRecursive(other.getRecursive()); } if (other.hasAlluxioOnly()) { setAlluxioOnly(other.getAlluxioOnly()); } if (other.hasUnchecked()) { setUnchecked(other.getUnchecked()); } if (other.hasCommonOptions()) { mergeCommonOptions(other.getCommonOptions()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
alluxio.grpc.DeletePOptions.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = options_.toBuilder();
/** * <code>optional .alluxio.grpc.file.DeletePOptions options = 2;</code> */ public alluxio.grpc.DeletePOptions getOptions() { if (optionsBuilder_ == null) { return options_ == null ? alluxio.grpc.DeletePOptions.getDefaultInstance() : options_; } else { return optionsBuilder_.getMessage(); } } /**
private void deleteObject(String bucket, String object) throws S3Exception { String bucketPath = parseBucketPath(AlluxioURI.SEPARATOR + bucket); // Delete the object. String objectPath = bucketPath + AlluxioURI.SEPARATOR + object; DeletePOptions options = DeletePOptions.newBuilder().setAlluxioOnly(ServerConfiguration .get(PropertyKey.PROXY_S3_DELETE_TYPE).equals(Constants.S3_DELETE_IN_ALLUXIO_ONLY)).build(); try { mFileSystem.delete(new AlluxioURI(objectPath), options); } catch (Exception e) { throw toObjectS3Exception(e, objectPath); } }
/** * Merges and embeds the given {@link DeletePOptions} with the corresponding master options. * * @param optionsBuilder Builder for proto {@link DeletePOptions} to merge with defaults * @return the instance of {@link DeleteContext} with default values for master */ public static DeleteContext defaults(DeletePOptions.Builder optionsBuilder) { DeletePOptions masterOptions = FileSystemMasterOptions.deleteDefaults(); DeletePOptions.Builder mergedOptionsBuilder = masterOptions.toBuilder().mergeFrom(optionsBuilder.build()); return new DeleteContext(mergedOptionsBuilder); }
/** * <code>optional .alluxio.grpc.file.DeletePOptions options = 2;</code> */ public alluxio.grpc.DeletePOptionsOrBuilder getOptionsOrBuilder() { if (optionsBuilder_ != null) { return optionsBuilder_.getMessageOrBuilder(); } else { return options_ == null ? alluxio.grpc.DeletePOptions.getDefaultInstance() : options_; } } /**