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

How to use
setUfsType
method
in
alluxio.wire.MountPointInfo

Best Java code snippets using alluxio.wire.MountPointInfo.setUfsType (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

 mUfsManager.get(mountInfo.getMountId()).acquireUfsResource()) {
UnderFileSystem ufs = ufsResource.get();
info.setUfsType(ufs.getUnderFSType());
try {
 info.setUfsCapacityBytes(
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.wireMountPointInfosetUfsType

Popular methods of MountPointInfo

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

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
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