public Builder mergeFrom(alluxio.proto.journal.File.AddMountPointEntry other) { if (other == alluxio.proto.journal.File.AddMountPointEntry.getDefaultInstance()) return this; if (other.hasAlluxioPath()) { bitField0_ |= 0x00000001; alluxioPath_ = other.alluxioPath_; onChanged(); if (other.hasUfsPath()) { bitField0_ |= 0x00000002; ufsPath_ = other.ufsPath_; onChanged(); if (other.hasReadOnly()) { setReadOnly(other.getReadOnly()); if (other.hasShared()) { setShared(other.getShared()); if (other.hasMountId()) { setMountId(other.getMountId());
result = result && (hasAlluxioPath() == other.hasAlluxioPath()); if (hasAlluxioPath()) { result = result && getAlluxioPath() .equals(other.getAlluxioPath()); result = result && (hasUfsPath() == other.hasUfsPath()); if (hasUfsPath()) { result = result && getUfsPath() .equals(other.getUfsPath()); result = result && (hasReadOnly() == other.hasReadOnly()); if (hasReadOnly()) { result = result && (getReadOnly() == other.getReadOnly()); result = result && getPropertiesList() .equals(other.getPropertiesList()); result = result && (hasShared() == other.hasShared()); if (hasShared()) { result = result && (getShared() == other.getShared()); result = result && (hasMountId() == other.hasMountId()); if (hasMountId()) { result = result && (getMountId() == other.getMountId());
mState.applyAndJournal(journalContext, AddMountPointEntry.newBuilder() .addAllProperties(properties.entrySet().stream() .map(entry -> StringPairEntry.newBuilder()
AddMountPointEntry.newBuilder().setAlluxioPath(inodePath.getUri().toString()) .setUfsPath(ufsPath.toString()).setMountId(mountId) .setReadOnly(options.isReadOnly())
public Builder mergeFrom(alluxio.proto.journal.File.AddMountPointEntry other) { if (other == alluxio.proto.journal.File.AddMountPointEntry.getDefaultInstance()) return this; if (other.hasAlluxioPath()) { bitField0_ |= 0x00000001; alluxioPath_ = other.alluxioPath_; onChanged(); if (other.hasUfsPath()) { bitField0_ |= 0x00000002; ufsPath_ = other.ufsPath_; onChanged(); if (other.hasReadOnly()) { setReadOnly(other.getReadOnly()); if (other.hasShared()) { setShared(other.getShared()); if (other.hasMountId()) { setMountId(other.getMountId()); this.mergeUnknownFields(other.getUnknownFields()); return this;
public alluxio.proto.journal.File.AddMountPointEntry buildPartial() { alluxio.proto.journal.File.AddMountPointEntry result = new alluxio.proto.journal.File.AddMountPointEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
@Override public Journal.JournalEntry next() { if (!hasNext()) { throw new NoSuchElementException(); } String alluxioPath = mEntry.getKey(); MountInfo info = mEntry.getValue(); mEntry = null; Map<String, String> properties = info.getOptions().getProperties(); List<File.StringPairEntry> protoProperties = new ArrayList<>(properties.size()); for (Map.Entry<String, String> property : properties.entrySet()) { protoProperties.add(File.StringPairEntry.newBuilder() .setKey(property.getKey()) .setValue(property.getValue()) .build()); } AddMountPointEntry addMountPoint = AddMountPointEntry.newBuilder().setAlluxioPath(alluxioPath) .setMountId(info.getMountId()).setUfsPath(info.getUfsUri().toString()) .setReadOnly(info.getOptions().isReadOnly()).addAllProperties(protoProperties) .setShared(info.getOptions().isShared()).build(); return Journal.JournalEntry.newBuilder().setAddMountPoint(addMountPoint).build(); }
/** * <code>optional .alluxio.proto.journal.AddMountPointEntry add_mount_point = 2;</code> */ public Builder mergeAddMountPoint(alluxio.proto.journal.File.AddMountPointEntry value) { if (addMountPointBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && addMountPoint_ != alluxio.proto.journal.File.AddMountPointEntry.getDefaultInstance()) { addMountPoint_ = alluxio.proto.journal.File.AddMountPointEntry.newBuilder(addMountPoint_).mergeFrom(value).buildPartial(); } else { addMountPoint_ = value; } onChanged(); } else { addMountPointBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
/** * Creates a new instance of {@link MountOptions} from {@link File.AddMountPointEntry}. * * @param options Proto options */ public MountOptions(File.AddMountPointEntry options) { this(); if (options != null) { if (options.hasReadOnly()) { mReadOnly = options.getReadOnly(); } for (File.StringPairEntry entry : options.getPropertiesList()) { mProperties.put(entry.getKey(), entry.getValue()); } if (options.hasShared()) { mShared = options.getShared(); } } }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(alluxio.proto.journal.File.AddMountPointEntry prototype) {
/** * @param entry the entry to use * @throws FileAlreadyExistsException if the mount point already exists * @throws InvalidPathException if an invalid path is encountered */ private void mountFromEntry(AddMountPointEntry entry) throws FileAlreadyExistsException, InvalidPathException, IOException { AlluxioURI alluxioURI = new AlluxioURI(entry.getAlluxioPath()); AlluxioURI ufsURI = new AlluxioURI(entry.getUfsPath()); try (LockedInodePath inodePath = mInodeTree .lockInodePath(alluxioURI, InodeTree.LockMode.WRITE)) { mountInternal(inodePath, ufsURI, entry.getMountId(), true /* replayed */, new MountOptions(entry)); } }
public static Builder newBuilder(alluxio.proto.journal.File.AddMountPointEntry prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * <code>optional string alluxio_path = 1;</code> */ public Builder clearAlluxioPath() { bitField0_ = (bitField0_ & ~0x00000001); alluxioPath_ = getDefaultInstance().getAlluxioPath(); onChanged(); return this; } /**
/** * <code>optional string ufs_path = 2;</code> */ public Builder clearUfsPath() { bitField0_ = (bitField0_ & ~0x00000002); ufsPath_ = getDefaultInstance().getUfsPath(); onChanged(); return this; } /**
public alluxio.proto.journal.File.AddMountPointEntry buildPartial() { alluxio.proto.journal.File.AddMountPointEntry result = new alluxio.proto.journal.File.AddMountPointEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
hash = (19 * hash) + getDescriptor().hashCode(); if (hasAlluxioPath()) { hash = (37 * hash) + ALLUXIO_PATH_FIELD_NUMBER; hash = (53 * hash) + getAlluxioPath().hashCode(); if (hasUfsPath()) { hash = (37 * hash) + UFS_PATH_FIELD_NUMBER; hash = (53 * hash) + getUfsPath().hashCode(); if (hasReadOnly()) { hash = (37 * hash) + READONLY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getReadOnly()); if (getPropertiesCount() > 0) { hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; hash = (53 * hash) + getPropertiesList().hashCode(); if (hasShared()) { hash = (37 * hash) + SHARED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getShared()); if (hasMountId()) { hash = (37 * hash) + MOUNT_ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getMountId());
@Override public Journal.JournalEntry next() { if (!hasNext()) { throw new NoSuchElementException(); } String alluxioPath = mEntry.getKey(); MountInfo info = mEntry.getValue(); mEntry = null; Map<String, String> properties = info.getOptions().getProperties(); List<File.StringPairEntry> protoProperties = new ArrayList<>(properties.size()); for (Map.Entry<String, String> property : properties.entrySet()) { protoProperties.add(File.StringPairEntry.newBuilder() .setKey(property.getKey()) .setValue(property.getValue()) .build()); } AddMountPointEntry addMountPoint = AddMountPointEntry.newBuilder().setAlluxioPath(alluxioPath) .setMountId(info.getMountId()).setUfsPath(info.getUfsUri().toString()) .setReadOnly(info.getOptions().getReadOnly()).addAllProperties(protoProperties) .setShared(info.getOptions().getShared()).build(); return Journal.JournalEntry.newBuilder().setAddMountPoint(addMountPoint).build(); }
/** * <code>optional .alluxio.proto.journal.AddMountPointEntry add_mount_point = 2;</code> */ public Builder mergeAddMountPoint(alluxio.proto.journal.File.AddMountPointEntry value) { if (addMountPointBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && addMountPoint_ != null && addMountPoint_ != alluxio.proto.journal.File.AddMountPointEntry.getDefaultInstance()) { addMountPoint_ = alluxio.proto.journal.File.AddMountPointEntry.newBuilder(addMountPoint_).mergeFrom(value).buildPartial(); } else { addMountPoint_ = value; } onChanged(); } else { addMountPointBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; return this; } /**
/** * Creates mount proto options from {@link File.AddMountPointEntry}. * @param mountEntryPoint mount point entry * @return created mount proto options */ public static MountPOptions fromMountEntry(File.AddMountPointEntry mountEntryPoint) { MountPOptions.Builder optionsBuilder = MountPOptions.newBuilder(); if (mountEntryPoint != null) { if (mountEntryPoint.hasReadOnly()) { optionsBuilder.setReadOnly(mountEntryPoint.getReadOnly()); } for (File.StringPairEntry entry : mountEntryPoint.getPropertiesList()) { optionsBuilder.putProperties(entry.getKey(), entry.getValue()); } if (mountEntryPoint.hasShared()) { optionsBuilder.setShared(mountEntryPoint.getShared()); } } return optionsBuilder.build(); }