congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Capacity
Code IndexAdd Tabnine to your IDE (free)

How to use
Capacity
in
alluxio.wire

Best Java code snippets using alluxio.wire.Capacity (Showing top 16 results out of 315)

origin: Alluxio/alluxio

private Capacity getUfsCapacityInternal() {
 MountPointInfo mountInfo = mFileSystemMaster.getMountTable().get(MountTable.ROOT);
 if (mountInfo == null) {
  return new Capacity().setTotal(-1).setUsed(-1);
 }
 long capacityBytes = mountInfo.getUfsCapacityBytes();
 long usedBytes = mountInfo.getUfsUsedBytes();
 return new Capacity().setTotal(capacityBytes).setUsed(usedBytes);
}
origin: Alluxio/alluxio

/**
 * @summary get the free ufs capacity in bytes, a negative value means the capacity is unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_FREE_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsFreeBytes() {
 return RestUtils.call(() -> {
  Capacity capacity = getUfsCapacityInternal();
  if (capacity.getTotal() >= 0 && capacity.getUsed() >= 0 && capacity.getTotal() >= capacity
    .getUsed()) {
   return capacity.getTotal() - capacity.getUsed();
  }
  return -1;
 }, ServerConfiguration.global());
}
origin: Alluxio/alluxio

/**
 * @summary get the used disk capacity, a negative value means the capacity is unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_USED_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsUsedBytes() {
 return RestUtils.call(() -> getUfsCapacityInternal().getUsed(), ServerConfiguration.global());
}
origin: Alluxio/alluxio

/**
 * @summary get the total ufs capacity in bytes, a negative value means the capacity is
 * unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_CAPACITY_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsCapacityBytes() {
 return RestUtils.call(() -> getUfsCapacityInternal().getTotal(), ServerConfiguration.global());
}
origin: org.alluxio/alluxio-core-server-master

/**
 * @summary get the used disk capacity, a negative value means the capacity is unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_USED_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsUsedBytes() {
 return RestUtils.call(() -> getUfsCapacityInternal().getUsed());
}
origin: org.alluxio/alluxio-core-server-master

/**
 * @summary get the total ufs capacity in bytes, a negative value means the capacity is unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_CAPACITY_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsCapacityBytes() {
 return RestUtils.call(() -> getUfsCapacityInternal().getTotal());
}
origin: Alluxio/alluxio

private Capacity getCapacityInternal() {
 return new Capacity().setTotal(mStoreMeta.getCapacityBytes())
   .setUsed(mStoreMeta.getUsedBytes());
}
origin: Alluxio/alluxio

/**
 * Checks if the two Capacity objects are equal.
 *
 * @param a the first Capacity object to be checked
 * @param b the second Capacity object to be checked
 */
private void checkEquality(Capacity a, Capacity b) {
 assertEquals(a.getTotal(), b.getTotal());
 assertEquals(a.getUsed(), b.getUsed());
 assertEquals(a, b);
}
origin: Alluxio/alluxio

private Capacity getCapacityInternal() {
 return new Capacity().setTotal(mBlockMaster.getCapacityBytes())
   .setUsed(mBlockMaster.getUsedBytes());
}
origin: org.alluxio/alluxio-core-server-master

/**
 * @summary get the free ufs capacity in bytes, a negative value means the capacity is unknown.
 * @return the response object
 * @deprecated since version 1.4 and will be removed in version 2.0
 * @see #getInfo(Boolean)
 */
@GET
@Path(GET_UFS_FREE_BYTES)
@ReturnType("java.lang.Long")
@Deprecated
public Response getUfsFreeBytes() {
 return RestUtils.call(() -> {
  Capacity capacity = getUfsCapacityInternal();
  if (capacity.getTotal() >= 0 && capacity.getUsed() >= 0 && capacity.getTotal() >= capacity
    .getUsed()) {
   return capacity.getTotal() - capacity.getUsed();
  }
  return -1;
 });
}
origin: Alluxio/alluxio

private Map<String, Capacity> getTierCapacityInternal() {
 SortedMap<String, Capacity> tierCapacity = new TreeMap<>(getTierAliasComparator());
 Map<String, Long> capacityBytesOnTiers = mStoreMeta.getCapacityBytesOnTiers();
 Map<String, Long> usedBytesOnTiers = mStoreMeta.getUsedBytesOnTiers();
 for (Map.Entry<String, Long> entry : capacityBytesOnTiers.entrySet()) {
  tierCapacity.put(entry.getKey(),
    new Capacity().setTotal(entry.getValue()).setUsed(usedBytesOnTiers.get(entry.getKey())));
 }
 return tierCapacity;
}
origin: Alluxio/alluxio

private Map<String, Capacity> getTierCapacityInternal() {
 SortedMap<String, Capacity> tierCapacity = new TreeMap<>();
 Map<String, Long> totalTierCapacity = mBlockMaster.getTotalBytesOnTiers();
 Map<String, Long> usedTierCapacity = mBlockMaster.getUsedBytesOnTiers();
 for (String tierAlias : mBlockMaster.getGlobalStorageTierAssoc().getOrderedStorageAliases()) {
  long total = totalTierCapacity.containsKey(tierAlias) ? totalTierCapacity.get(tierAlias) : 0;
  long used = usedTierCapacity.containsKey(tierAlias) ? usedTierCapacity.get(tierAlias) : 0;
  tierCapacity.put(tierAlias, new Capacity().setTotal(total).setUsed(used));
 }
 return tierCapacity;
}
origin: Alluxio/alluxio

 /**
  * Randomly creates a Capacity object.
  *
  * @return the created Capacity object
  */
 protected static Capacity createRandom() {
  Capacity result = new Capacity();
  Random random = new Random();

  long total = random.nextLong();
  long used = random.nextLong();

  result.setTotal(total);
  result.setUsed(used);

  return result;
 }
}
origin: org.alluxio/alluxio-core-server-master

private Capacity getUfsCapacityInternal() {
 MountPointInfo mountInfo = mFileSystemMaster.getMountTable().get(MountTable.ROOT);
 if (mountInfo == null) {
  return new Capacity().setTotal(-1).setUsed(-1);
 }
 long capacityBytes = mountInfo.getUfsCapacityBytes();
 long usedBytes = mountInfo.getUfsUsedBytes();
 return new Capacity().setTotal(capacityBytes).setUsed(usedBytes);
}
origin: org.alluxio/alluxio-core-server-master

private Capacity getCapacityInternal() {
 return new Capacity().setTotal(mBlockMaster.getCapacityBytes())
   .setUsed(mBlockMaster.getUsedBytes());
}
origin: org.alluxio/alluxio-core-server-master

private Map<String, Capacity> getTierCapacityInternal() {
 SortedMap<String, Capacity> tierCapacity = new TreeMap<>();
 Map<String, Long> totalTierCapacity = mBlockMaster.getTotalBytesOnTiers();
 Map<String, Long> usedTierCapacity = mBlockMaster.getUsedBytesOnTiers();
 for (String tierAlias : mBlockMaster.getGlobalStorageTierAssoc().getOrderedStorageAliases()) {
  long total = totalTierCapacity.containsKey(tierAlias) ? totalTierCapacity.get(tierAlias) : 0;
  long used = usedTierCapacity.containsKey(tierAlias) ? usedTierCapacity.get(tierAlias) : 0;
  tierCapacity.put(tierAlias, new Capacity().setTotal(total).setUsed(used));
 }
 return tierCapacity;
}
alluxio.wireCapacity

Javadoc

Class that represents the available, free, and total capacity.

Most used methods

  • <init>
    Creates a new instance of Capacity.
  • setTotal
  • setUsed
  • getTotal
  • getUsed

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • BoxLayout (javax.swing)
  • Join (org.hibernate.mapping)
  • CodeWhisperer alternatives
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