Java源码示例:org.apache.hadoop.mapreduce.counters.Limits

示例1
private void testMaxCounters(final Counters counters) {
  LOG.info("counters max="+ Limits.getCountersMax());
  for (int i = 0; i < Limits.getCountersMax(); ++i) {
    counters.findCounter("test", "test"+ i);
  }
  setExpected(counters);
  shouldThrow(LimitExceededException.class, new Runnable() {
    public void run() {
      counters.findCounter("test", "bad");
    }
  });
  checkExpected(counters);
}
 
示例2
private void testMaxGroups(final Counters counters) {
  LOG.info("counter groups max="+ Limits.getGroupsMax());
  for (int i = 0; i < Limits.getGroupsMax(); ++i) {
    // assuming COUNTERS_MAX > GROUPS_MAX
    counters.findCounter("test"+ i, "test");
  }
  setExpected(counters);
  shouldThrow(LimitExceededException.class, new Runnable() {
    public void run() {
      counters.findCounter("bad", "test");
    }
  });
  checkExpected(counters);
}
 
示例3
private void testMaxCounters(final Counters counters) {
  LOG.info("counters max="+ Limits.getCountersMax());
  for (int i = 0; i < Limits.getCountersMax(); ++i) {
    counters.findCounter("test", "test"+ i);
  }
  setExpected(counters);
  shouldThrow(LimitExceededException.class, new Runnable() {
    public void run() {
      counters.findCounter("test", "bad");
    }
  });
  checkExpected(counters);
}
 
示例4
private void testMaxGroups(final Counters counters) {
  LOG.info("counter groups max="+ Limits.getGroupsMax());
  for (int i = 0; i < Limits.getGroupsMax(); ++i) {
    // assuming COUNTERS_MAX > GROUPS_MAX
    counters.findCounter("test"+ i, "test");
  }
  setExpected(counters);
  shouldThrow(LimitExceededException.class, new Runnable() {
    public void run() {
      counters.findCounter("bad", "test");
    }
  });
  checkExpected(counters);
}
 
示例5
GenericGroup(String name, String displayName, Limits limits) {
  super(name, displayName, limits);
}
 
示例6
@Override
protected Group newGenericGroup(String name, String displayName,
                                Limits limits) {
  return new Group(new GenericGroup(name, displayName, limits));
}
 
示例7
GenericGroup(String name, String displayName, Limits limits) {
  super(name, displayName, limits);
}
 
示例8
@Override
protected CounterGroup newGenericGroup(String name, String displayName,
                                       Limits limits) {
  return new GenericGroup(name, displayName, limits);
}
 
示例9
GenericGroup(String name, String displayName, Limits limits) {
  super(name, displayName, limits);
}
 
示例10
@Override
protected Group newGenericGroup(String name, String displayName,
                                Limits limits) {
  return new Group(new GenericGroup(name, displayName, limits));
}
 
示例11
GenericGroup(String name, String displayName, Limits limits) {
  super(name, displayName, limits);
}
 
示例12
@Override
protected CounterGroup newGenericGroup(String name, String displayName,
                                       Limits limits) {
  return new GenericGroup(name, displayName, limits);
}
 
示例13
/** {@inheritDoc} */
@Override public Limits limits() {
    return null;
}