public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder mergeFrom(alluxio.grpc.SetAttributePOptions other) { if (other == alluxio.grpc.SetAttributePOptions.getDefaultInstance()) return this; if (other.hasPinned()) { setPinned(other.getPinned()); if (other.hasTtl()) { setTtl(other.getTtl()); if (other.hasTtlAction()) { setTtlAction(other.getTtlAction()); if (other.hasPersisted()) { setPersisted(other.getPersisted()); if (other.hasOwner()) { bitField0_ |= 0x00000010; owner_ = other.owner_; onChanged(); if (other.hasGroup()) { bitField0_ |= 0x00000020; group_ = other.group_; onChanged(); if (other.hasMode()) { mergeMode(other.getMode()); if (other.hasRecursive()) { setRecursive(other.getRecursive());
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(alluxio.grpc.SetAttributePOptions prototype) {
/** * <code>optional string group = 6;</code> */ public Builder clearGroup() { bitField0_ = (bitField0_ & ~0x00000020); group_ = getDefaultInstance().getGroup(); onChanged(); return this; } /**
/** * <code>optional string owner = 5;</code> */ public Builder clearOwner() { bitField0_ = (bitField0_ & ~0x00000010); owner_ = getDefaultInstance().getOwner(); onChanged(); return this; } /**
result = result && (hasPinned() == other.hasPinned()); if (hasPinned()) { result = result && (getPinned() == other.getPinned()); result = result && (hasTtl() == other.hasTtl()); if (hasTtl()) { result = result && (getTtl() == other.getTtl()); result = result && (hasTtlAction() == other.hasTtlAction()); if (hasTtlAction()) { result = result && ttlAction_ == other.ttlAction_; result = result && (hasPersisted() == other.hasPersisted()); if (hasPersisted()) { result = result && (getPersisted() == other.getPersisted()); result = result && (hasOwner() == other.hasOwner()); if (hasOwner()) { result = result && getOwner() .equals(other.getOwner()); result = result && (hasGroup() == other.hasGroup()); if (hasGroup()) { result = result && getGroup() .equals(other.getGroup());
/** * <code>optional .alluxio.grpc.file.SetAttributePOptions options = 2;</code> */ public Builder mergeOptions(alluxio.grpc.SetAttributePOptions value) { if (optionsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && options_ != null && options_ != alluxio.grpc.SetAttributePOptions.getDefaultInstance()) { options_ = alluxio.grpc.SetAttributePOptions.newBuilder(options_).mergeFrom(value).buildPartial(); } else { options_ = value; } onChanged(); } else { optionsBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
/** * <code>optional .alluxio.grpc.file.SetAttributePOptions options = 2;</code> */ public alluxio.grpc.SetAttributePOptions getOptions() { return options_ == null ? alluxio.grpc.SetAttributePOptions.getDefaultInstance() : options_; } /**
@Test public void setStateSuccess() throws Exception { // set unmask try (Closeable c = new ConfigurationRule( PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK, "000", ServerConfiguration.global()).toResource()) { String file = PathUtils.concatPath(TEST_DIR_URI, "testState1"); verifyCreateFile(TEST_USER_1, file, false); SetAttributePOptions expect = getNonDefaultSetState(); SetAttributePOptions result = verifySetState(TEST_USER_2, file, expect); assertEquals(expect.getTtl(), result.getTtl()); assertEquals(expect.getTtlAction(), result.getTtlAction()); assertEquals(expect.getPinned(), result.getPinned()); } }
/** * <code>optional .alluxio.grpc.file.SetAttributePOptions options = 2;</code> */ public alluxio.grpc.SetAttributePOptionsOrBuilder getOptionsOrBuilder() { return options_ == null ? alluxio.grpc.SetAttributePOptions.getDefaultInstance() : options_; }
/** * Sets pin state for the input path. * * @param fs The {@link FileSystem} client * @param path The {@link AlluxioURI} path as the input of the command * @param pinned the state to be set */ public static void setPinned(FileSystem fs, AlluxioURI path, boolean pinned) throws AlluxioException, IOException { SetAttributePOptions options = SetAttributePOptions.newBuilder().setPinned(pinned).build(); fs.setAttribute(path, options); } }
hash = (19 * hash) + getDescriptor().hashCode(); if (hasPinned()) { hash = (37 * hash) + PINNED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getPinned()); if (hasTtl()) { hash = (37 * hash) + TTL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getTtl()); if (hasTtlAction()) { hash = (37 * hash) + TTLACTION_FIELD_NUMBER; hash = (53 * hash) + ttlAction_; if (hasPersisted()) { hash = (37 * hash) + PERSISTED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getPersisted()); if (hasOwner()) { hash = (37 * hash) + OWNER_FIELD_NUMBER; hash = (53 * hash) + getOwner().hashCode(); if (hasGroup()) { hash = (37 * hash) + GROUP_FIELD_NUMBER; hash = (53 * hash) + getGroup().hashCode(); if (hasMode()) {
public alluxio.grpc.SetAttributePOptions getDefaultInstanceForType() { return alluxio.grpc.SetAttributePOptions.getDefaultInstance(); }
public static Builder newBuilder(alluxio.grpc.SetAttributePOptions prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
/** * Changes the owner for the path specified in args. * * @param path The {@link AlluxioURI} path as the input of the command * @param owner The owner to be updated to the file or directory * @param recursive Whether change the owner recursively */ private void chown(AlluxioURI path, String owner, boolean recursive) throws AlluxioException, IOException { SetAttributePOptions options = SetAttributePOptions.newBuilder().setOwner(owner).setRecursive(recursive).build(); mFileSystem.setAttribute(path, options); System.out.println("Changed owner of " + path + " to " + owner); }
/** * <code>optional .alluxio.grpc.file.SetAttributePOptions options = 2;</code> */ public alluxio.grpc.SetAttributePOptions getOptions() { if (optionsBuilder_ == null) { return options_ == null ? alluxio.grpc.SetAttributePOptions.getDefaultInstance() : options_; } else { return optionsBuilder_.getMessage(); } } /**
/** * @return the instance of {@link SetAttributeContext} with default values for master */ public static SetAttributeContext defaults() { SetAttributePOptions masterOptions = FileSystemMasterOptions.setAttributesDefaults(); return new SetAttributeContext(masterOptions.toBuilder()); }
/** * Changes the group for the directory or file with the path specified in args. * * @param path The {@link AlluxioURI} path as the input of the command * @param group The group to be updated to the file or directory * @param recursive Whether change the group recursively */ private void chgrp(AlluxioURI path, String group, boolean recursive) throws AlluxioException, IOException { SetAttributePOptions options = SetAttributePOptions.newBuilder().setGroup(group).setRecursive(recursive).build(); mFileSystem.setAttribute(path, options); System.out.println("Changed group of " + path + " to " + group); }
/** * <code>optional .alluxio.grpc.file.SetAttributePOptions options = 2;</code> */ public alluxio.grpc.SetAttributePOptionsOrBuilder getOptionsOrBuilder() { if (optionsBuilder_ != null) { return optionsBuilder_.getMessageOrBuilder(); } else { return options_ == null ? alluxio.grpc.SetAttributePOptions.getDefaultInstance() : options_; } } /**
alluxio.grpc.SetAttributePOptions.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = options_.toBuilder();