Tabnine Logo
MountPointInfo.setUfsCapacityBytes
Code IndexAdd Tabnine to your IDE (free)

How to use
setUfsCapacityBytes
method
in
alluxio.wire.MountPointInfo

Best Java code snippets using alluxio.wire.MountPointInfo.setUfsCapacityBytes (Showing top 5 results out of 315)

origin: Alluxio/alluxio

 public static MountPointInfo createRandom() {
  Random random = new Random();
  String ufsUri = CommonUtils.randomAlphaNumString(random.nextInt(10));
  String ufsType = CommonUtils.randomAlphaNumString(random.nextInt(10));
  long ufsCapacityBytes = random.nextLong();
  long ufsUsedBytes = random.nextLong();
  boolean readOnly = random.nextBoolean();
  Map<String, String> properties = new HashMap<>();
  for (int i = 0, n = random.nextInt(10) + 1; i < n; i++) {
   properties.put(CommonUtils.randomAlphaNumString(random.nextInt(5)),
     CommonUtils.randomAlphaNumString(random.nextInt(5)));
  }

  MountPointInfo result = new MountPointInfo();
  result.setUfsUri(ufsUri);
  result.setUfsType(ufsType);
  result.setUfsCapacityBytes(ufsCapacityBytes);
  result.setUfsUsedBytes(ufsUsedBytes);
  result.setReadOnly(readOnly);
  result.setProperties(properties);

  return result;
 }
}
origin: Alluxio/alluxio

/**
 * Gets the mount point information from a mount information.
 *
 * @param mountInfo the mount information to transform
 * @return the mount point information
 */
private MountPointInfo getMountPointInfo(MountInfo mountInfo) {
 MountPointInfo info = mountInfo.toMountPointInfo();
 try (CloseableResource<UnderFileSystem> ufsResource =
      mUfsManager.get(mountInfo.getMountId()).acquireUfsResource()) {
  UnderFileSystem ufs = ufsResource.get();
  info.setUfsType(ufs.getUnderFSType());
  try {
   info.setUfsCapacityBytes(
     ufs.getSpace(info.getUfsUri(), UnderFileSystem.SpaceType.SPACE_TOTAL));
  } catch (IOException e) {
   LOG.warn("Cannot get total capacity of {}", info.getUfsUri(), e);
  }
  try {
   info.setUfsUsedBytes(
     ufs.getSpace(info.getUfsUri(), UnderFileSystem.SpaceType.SPACE_USED));
  } catch (IOException e) {
   LOG.warn("Cannot get used capacity of {}", info.getUfsUri(), e);
  }
 } catch (UnavailableException | NotFoundException e) {
  // We should never reach here
  LOG.error("No UFS cached for {}", info, e);
 }
 return info;
}
origin: Alluxio/alluxio

/**
 * Converts a proto type to a wire type.
 *
 * @param mountPointPInfo the proto type to convert
 * @return the converted wire type
 */
public static MountPointInfo fromProto(alluxio.grpc.MountPointInfo mountPointPInfo) {
 return new MountPointInfo().setUfsUri(mountPointPInfo.getUfsUri())
   .setUfsType(mountPointPInfo.getUfsType())
   .setUfsCapacityBytes(mountPointPInfo.getUfsCapacityBytes())
   .setUfsUsedBytes(mountPointPInfo.getUfsUsedBytes())
   .setReadOnly(mountPointPInfo.getReadOnly())
   .setProperties(mountPointPInfo.getPropertiesMap()).setShared(mountPointPInfo.getShared());
}
origin: org.alluxio/alluxio-core-server-master

info.setUfsType(ufs.getUnderFSType());
try {
 info.setUfsCapacityBytes(
   ufs.getSpace(info.getUfsUri(), UnderFileSystem.SpaceType.SPACE_TOTAL));
} catch (IOException e) {
origin: org.alluxio/alluxio-core-common

/**
 * Creates a new instance of {@link MountPointInfo} from thrift representation.
 *
 * @param info the thrift representation of a mount point information
 * @return the instance
 */
public static MountPointInfo fromThrift(alluxio.thrift.MountPointInfo info) {
 return new MountPointInfo()
   .setUfsUri(info.getUfsUri())
   .setUfsType(info.getUfsType())
   .setUfsCapacityBytes(info.getUfsCapacityBytes())
   .setUfsUsedBytes(info.getUfsUsedBytes())
   .setReadOnly(info.isReadOnly())
   .setProperties(info.getProperties())
   .setShared(info.isShared());
}
alluxio.wireMountPointInfosetUfsCapacityBytes

Popular methods of MountPointInfo

  • getReadOnly
  • getUfsCapacityBytes
  • getUfsUri
  • <init>
    Creates a new instance of MountPointInfo.
  • getProperties
  • getUfsType
  • getUfsUsedBytes
  • setProperties
  • setReadOnly
  • setUfsType
  • setUfsUri
  • setUfsUsedBytes
  • setUfsUri,
  • setUfsUsedBytes,
  • getShared,
  • setShared,
  • toThrift

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now