Examples of record()


Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

    }

    final Errors errors = new Errors(LOG);
    // expected nothing but got something
    if (!outputs.isEmpty() && expectedOutputs.isEmpty()) {
      errors.record("Expected no output; got %d output(s).", outputs.size());
      errors.assertNone();
    }
    // expected something but got nothing
    if (outputs.isEmpty() && !expectedOutputs.isEmpty()) {
      errors.record("Expected %d output(s); got no output.",
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

      errors.record("Expected no output; got %d output(s).", outputs.size());
      errors.assertNone();
    }
    // expected something but got nothing
    if (outputs.isEmpty() && !expectedOutputs.isEmpty()) {
      errors.record("Expected %d output(s); got no output.",
          expectedOutputs.size());
      errors.assertNone();
    }

    // now, the smart test needs to be done
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

        }
      }

      if (outputKeyClass != null && expectedKeyClass != null
          && !outputKeyClass.equals(expectedKeyClass)) {
        errors.record("Mismatch in key class: expected: %s actual: %s",
            expectedKeyClass, outputKeyClass);
      }

      if (outputValueClass != null && expectedValueClass != null
          && !outputValueClass.equals(expectedValueClass)) {
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

            expectedKeyClass, outputKeyClass);
      }

      if (outputValueClass != null && expectedValueClass != null
          && !outputValueClass.equals(expectedValueClass)) {
        errors.record("Mismatch in value class: expected: %s actual: %s",
            expectedValueClass, outputValueClass);
      }
    }
    errors.assertNone();
  }
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

  protected void validate(final MockMultipleOutputs mos) {
    final Errors errors = new Errors(LOG);

    if (mos != null && !mos.isNamedOutputsEmpty()
        && expectedMultipleOutputs.isEmpty()) {
      errors.record(
          "Expected no multiple outputs; got %d named MultipleOutputs.",
          mos.getMultipleOutputsCount());
    }

    Map<String, List<Pair<?, ?>>> actuals = buildActualMultipleOutputs(mos);
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

    actuals.clear();
    expects.clear();

    if (mos != null && !mos.isPathOutputsEmpty()
        && expectedPathOutputs.isEmpty()) {
      errors.record("Expected no pathOutputs; got %d pathOutputs.",
          mos.getPathOutputsCount());
    }

    actuals = buildActualPathOutputs(mos);
    expects = buildExpectedPathOutputs();
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

    for (final Pair<Enum<?>, Long> expected : expectedEnumCounters) {
      final long actualValue = counterWrapper.findCounterValue(expected
          .getFirst());

      if (actualValue != expected.getSecond()) {
        errors.record("Counter %s.%s has value %d instead of expected %d",
            expected.getFirst().getDeclaringClass().getCanonicalName(),
            expected.getFirst().toString(), actualValue, expected.getSecond());
      }
    }
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

      final long actualValue = counterWrapper.findCounterValue(
          counter.getFirst(), counter.getSecond());

      if (actualValue != expected.getSecond()) {
        errors
            .record(
                "Counter with category %s and name %s has value %d instead of expected %d",
                counter.getFirst(), counter.getSecond(), actualValue,
                expected.getSecond());
      }
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.util.Errors.record()

          .findCounterValues();
      Collection<Pair<String, String>> findExpectedCounterValues = findExpectedCounterValues();
      unmatchedCounters.removeAll(findExpectedCounterValues);
      if (!unmatchedCounters.isEmpty()) {
        for (Pair<String, String> unmatcherCounter : unmatchedCounters) {
          errors
              .record(
                  "Actual counter (\"%s\",\"%s\") was not found in expected counters",
                  unmatcherCounter.getFirst(), unmatcherCounter.getSecond());
        }
      }
View Full Code Here

Examples of org.apache.kafka.common.metrics.Sensor.record()

                        maybeRegisterTopicMetrics(topic);

                        // per-topic record send rate
                        String topicRecordsCountName = "topic." + topic + ".records-per-batch";
                        Sensor topicRecordCount = Utils.notNull(this.metrics.getSensor(topicRecordsCountName));
                        topicRecordCount.record(batch.recordCount);

                        // per-topic bytes send rate
                        String topicByteRateName = "topic." + topic + ".bytes";
                        Sensor topicByteRate = Utils.notNull(this.metrics.getSensor(topicByteRateName));
                        topicByteRate.record(batch.records.sizeInBytes());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.