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

How to use
BlockMasterInfo
in
alluxio.wire

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

origin: Alluxio/alluxio

/**
 * Creates a new instance of {@link BlockMasterInfo} from a proto representation.
 *
 * @param info the proto representation of a block master information
 * @return the instance
 */
public static BlockMasterInfo fromProto(alluxio.grpc.BlockMasterInfo info) {
 return new BlockMasterInfo()
   .setCapacityBytes(info.getCapacityBytes())
   .setCapacityBytesOnTiers(info.getCapacityBytesOnTiersMap())
   .setFreeBytes(info.getFreeBytes())
   .setLiveWorkerNum(info.getLiveWorkerNum())
   .setLostWorkerNum(info.getLostWorkerNum())
   .setUsedBytes(info.getUsedBytes())
   .setUsedBytesOnTiers(info.getUsedBytesOnTiersMap());
}
origin: Alluxio/alluxio

@Override
public BlockMasterInfo getBlockMasterInfo(final Set<BlockMasterInfoField> fields)
  throws IOException {
 return retryRPC(() -> {
  return BlockMasterInfo
    .fromProto(mClient.getBlockMasterInfo(GetBlockMasterInfoPOptions.newBuilder()
      .addAllFilters(
        fields.stream().map(BlockMasterInfoField::toProto).collect(Collectors.toList()))
      .build()).getBlockMasterInfo());
 });
}
origin: Alluxio/alluxio

public void checkEquality(BlockMasterInfo a, BlockMasterInfo b) {
 Assert.assertEquals(a.getCapacityBytes(), b.getCapacityBytes());
 Assert.assertEquals(a.getCapacityBytesOnTiers(), b.getCapacityBytesOnTiers());
 Assert.assertEquals(a.getFreeBytes(), b.getFreeBytes());
 Assert.assertEquals(a.getLiveWorkerNum(), b.getLiveWorkerNum());
 Assert.assertEquals(a.getLostWorkerNum(), b.getLostWorkerNum());
 Assert.assertEquals(a.getUsedBytes(), b.getUsedBytes());
 Assert.assertEquals(a.getUsedBytesOnTiers(), b.getUsedBytesOnTiers());
 Assert.assertEquals(a, b);
}
origin: Alluxio/alluxio

@Test
public void proto() {
 BlockMasterInfo blockMasterInfo = createRandom();
 BlockMasterInfo other = BlockMasterInfo.fromProto(blockMasterInfo.toProto());
 checkEquality(blockMasterInfo, other);
}
origin: Alluxio/alluxio

 public static BlockMasterInfo createRandom() {
  BlockMasterInfo result = new BlockMasterInfo();
  Random random = new Random();

  long capacityBytes = random.nextLong();
  Map<String, Long> capacityBytesOnTiers = new HashMap<>();
  capacityBytesOnTiers.put("MEM", capacityBytes);
  long freeBytes = random.nextLong();
  int liveWorkerNum = random.nextInt(10);
  int lostWorkerNum = random.nextInt(10);
  long usedBytes = random.nextLong();
  Map<String, Long> usedBytesOnTiers = new HashMap<>();
  usedBytesOnTiers.put("MEM", capacityBytes);

  result.setCapacityBytes(capacityBytes);
  result.setCapacityBytesOnTiers(capacityBytesOnTiers);
  result.setFreeBytes(freeBytes);
  result.setLiveWorkerNum(liveWorkerNum);
  result.setLostWorkerNum(lostWorkerNum);
  result.setUsedBytes(usedBytes);
  result.setUsedBytesOnTiers(usedBytesOnTiers);

  return result;
 }
}
origin: Alluxio/alluxio

BlockMasterInfo blockMasterInfo = mBlockMasterClient.getBlockMasterInfo(blockMasterInfoFilter);
print("Live Workers: " + blockMasterInfo.getLiveWorkerNum());
print("Lost Workers: " + blockMasterInfo.getLostWorkerNum());
  + FormatUtils.getSizeFromBytes(blockMasterInfo.getCapacityBytes()));
totalCapacityOnTiers.putAll(blockMasterInfo.getCapacityBytesOnTiers());
for (Map.Entry<String, Long> capacityBytesTier : totalCapacityOnTiers.entrySet()) {
 print("Tier: " + capacityBytesTier.getKey()
  + FormatUtils.getSizeFromBytes(blockMasterInfo.getUsedBytes()));
usedCapacityOnTiers.putAll(blockMasterInfo.getUsedBytesOnTiers());
for (Map.Entry<String, Long> usedBytesTier: usedCapacityOnTiers.entrySet()) {
 print("Tier: " + usedBytesTier.getKey()
  + FormatUtils.getSizeFromBytes(blockMasterInfo.getFreeBytes()));
origin: org.alluxio/alluxio-core-common

/**
 * Creates a new instance of {@link BlockMasterInfo} from a thrift representation.
 *
 * @param info the thrift representation of a block master information
 * @return the instance
 */
public static BlockMasterInfo fromThrift(alluxio.thrift.BlockMasterInfo info) {
 return new BlockMasterInfo()
   .setCapacityBytes(info.getCapacityBytes())
   .setCapacityBytesOnTiers(info.getCapacityBytesOnTiers())
   .setFreeBytes(info.getFreeBytes())
   .setLiveWorkerNum(info.getLiveWorkerNum())
   .setLostWorkerNum(info.getLostWorkerNum())
   .setUsedBytes(info.getUsedBytes())
   .setUsedBytesOnTiers(info.getUsedBytesOnTiers());
}
alluxio.wireBlockMasterInfo

Javadoc

The Alluxio block master information.

Most used methods

  • <init>
    Creates a new instance of BlockMasterInfo.
  • fromProto
    Creates a new instance of BlockMasterInfo from a proto representation.
  • getCapacityBytes
  • getCapacityBytesOnTiers
  • getFreeBytes
  • getLiveWorkerNum
  • getLostWorkerNum
  • getUsedBytes
  • getUsedBytesOnTiers
  • setCapacityBytes
  • setCapacityBytesOnTiers
  • setFreeBytes
  • setCapacityBytesOnTiers,
  • setFreeBytes,
  • setLiveWorkerNum,
  • setLostWorkerNum,
  • setUsedBytes,
  • setUsedBytesOnTiers,
  • toProto

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook extensions
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