Java Code Examples for org.apache.hadoop.fs.StorageType#ordinal()

The following examples show how to use org.apache.hadoop.fs.StorageType#ordinal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContentSummary.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/** Returns true if any storage type quota has been set*/
public boolean isTypeQuotaSet() {
  if (typeQuota == null) {
    return false;
  }
  for (StorageType t : StorageType.getTypesSupportingQuota()) {
    if (typeQuota[t.ordinal()] > 0) {
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: ContentSummary.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/** Returns true if any storage type consumption information is available*/
public boolean isTypeConsumedAvailable() {
  if (typeConsumed == null) {
    return false;
  }
  for (StorageType t : StorageType.getTypesSupportingQuota()) {
    if (typeConsumed[t.ordinal()] > 0) {
      return true;
    }
  }
  return false;
}
 
Example 3
Source File: ContentSummary.java    From big-c with Apache License 2.0 5 votes vote down vote up
/** Returns true if any storage type quota has been set*/
public boolean isTypeQuotaSet() {
  if (typeQuota == null) {
    return false;
  }
  for (StorageType t : StorageType.getTypesSupportingQuota()) {
    if (typeQuota[t.ordinal()] > 0) {
      return true;
    }
  }
  return false;
}
 
Example 4
Source File: ContentSummary.java    From big-c with Apache License 2.0 5 votes vote down vote up
/** Returns true if any storage type consumption information is available*/
public boolean isTypeConsumedAvailable() {
  if (typeConsumed == null) {
    return false;
  }
  for (StorageType t : StorageType.getTypesSupportingQuota()) {
    if (typeConsumed[t.ordinal()] > 0) {
      return true;
    }
  }
  return false;
}
 
Example 5
Source File: ContentSummary.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public Builder typeQuota(StorageType type, long quota) {
  this.typeQuota[type.ordinal()] = quota;
  return this;
}
 
Example 6
Source File: ContentSummary.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public Builder typeConsumed(StorageType type, long consumed) {
  this.typeConsumed[type.ordinal()] = consumed;
  return this;
}
 
Example 7
Source File: ContentSummary.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/** Returns storage type quota */
public long getTypeQuota(StorageType type) {
  return (typeQuota != null) ? typeQuota[type.ordinal()] : -1;
}
 
Example 8
Source File: ContentSummary.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/** Returns storage type consumed*/
public long getTypeConsumed(StorageType type) {
  return (typeConsumed != null) ? typeConsumed[type.ordinal()] : 0;
}
 
Example 9
Source File: ContentSummary.java    From big-c with Apache License 2.0 4 votes vote down vote up
public Builder typeQuota(StorageType type, long quota) {
  this.typeQuota[type.ordinal()] = quota;
  return this;
}
 
Example 10
Source File: ContentSummary.java    From big-c with Apache License 2.0 4 votes vote down vote up
public Builder typeConsumed(StorageType type, long consumed) {
  this.typeConsumed[type.ordinal()] = consumed;
  return this;
}
 
Example 11
Source File: ContentSummary.java    From big-c with Apache License 2.0 4 votes vote down vote up
/** Returns storage type quota */
public long getTypeQuota(StorageType type) {
  return (typeQuota != null) ? typeQuota[type.ordinal()] : -1;
}
 
Example 12
Source File: ContentSummary.java    From big-c with Apache License 2.0 4 votes vote down vote up
/** Returns storage type consumed*/
public long getTypeConsumed(StorageType type) {
  return (typeConsumed != null) ? typeConsumed[type.ordinal()] : 0;
}