@Override public StringAnalysisCounter add(Writable writable) { int length = writable.toString().length(); if (length == 0) countZeroLength++; if (length == getMinLengthSeen()) countMinLength++; else if (length < getMinLengthSeen()) { countMinLength = 1; } if (length == getMaxLengthSeen()) countMaxLength++; else if (length > getMaxLengthSeen()) { countMaxLength = 1; } counter.merge((double) length); return this; }
@Override public StringAnalysisCounter add(Writable writable) { int length = writable.toString().length(); if (length == 0) countZeroLength++; if (length == getMinLengthSeen()) countMinLength++; else if (length < getMinLengthSeen()) { countMinLength = 1; } if (length == getMaxLengthSeen()) countMaxLength++; else if (length > getMaxLengthSeen()) { countMaxLength = 1; } counter.merge((double) length); return this; }
@Override public IntegerAnalysisCounter add(Writable writable) { int value = writable.toInt(); if (value == 0) countZero++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge((double) value); return this; }
@Override public LongAnalysisCounter add(Writable writable) { long value = writable.toLong(); if (value == 0) countZero++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge((double) value); return this; }
@Override public IntegerAnalysisCounter add(Writable writable) { int value = writable.toInt(); if (value == 0) countZero++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge((double) value); return this; }
@Override public LongAnalysisCounter add(Writable writable) { long value = writable.toLong(); if (value == 0) countZero++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge((double) value); return this; }
@Override public DoubleAnalysisCounter add(Writable writable) { double value = writable.toDouble(); if (value == 0) countZero++; if (value == Double.NaN) countNaN++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge(value); return this; }
@Override public DoubleAnalysisCounter add(Writable writable) { double value = writable.toDouble(); if (value == 0) countZero++; if (value == Double.NaN) countNaN++; if (value == getMinValueSeen()) countMinValue++; else if (value < getMinValueSeen()) { countMinValue = 1; } if (value == getMaxValueSeen()) countMaxValue++; else if (value > getMaxValueSeen()) { countMaxValue = 1; } if (value >= 0) { countPositive++; } else { countNegative++; } ; counter.merge(value); return this; }
public StringAnalysisCounter merge(StringAnalysisCounter other) { int otherMin = other.getMinLengthSeen(); long newCountMinLength; if (getMinLengthSeen() == otherMin) { newCountMinLength = countMinLength + other.getCountMinLength(); } else if (getMinLengthSeen() > otherMin) { //Keep other, take count from other newCountMinLength = other.getCountMinLength(); } else { //Keep this min, no change to count newCountMinLength = countMinLength; } int otherMax = other.getMaxLengthSeen(); long newCountMaxLength; if (getMaxLengthSeen() == otherMax) { newCountMaxLength = countMaxLength + other.getCountMaxLength(); } else if (getMaxLengthSeen() < otherMax) { //Keep other, take count from other newCountMaxLength = other.getCountMaxLength(); } else { //Keep this max, no change to count newCountMaxLength = countMaxLength; } return new StringAnalysisCounter(counter.merge(other.getCounter()), countZeroLength + other.getCountZeroLength(), newCountMinLength, newCountMaxLength); } }
public StringAnalysisCounter merge(StringAnalysisCounter other) { int otherMin = other.getMinLengthSeen(); long newCountMinLength; if (getMinLengthSeen() == otherMin) { newCountMinLength = countMinLength + other.getCountMinLength(); } else if (getMinLengthSeen() > otherMin) { //Keep other, take count from other newCountMinLength = other.getCountMinLength(); } else { //Keep this min, no change to count newCountMinLength = countMinLength; } int otherMax = other.getMaxLengthSeen(); long newCountMaxLength; if (getMaxLengthSeen() == otherMax) { newCountMaxLength = countMaxLength + other.getCountMaxLength(); } else if (getMaxLengthSeen() < otherMax) { //Keep other, take count from other newCountMaxLength = other.getCountMaxLength(); } else { //Keep this max, no change to count newCountMaxLength = countMaxLength; } return new StringAnalysisCounter(counter.merge(other.getCounter()), countZeroLength + other.getCountZeroLength(), newCountMinLength, newCountMaxLength); } }
public IntegerAnalysisCounter merge(IntegerAnalysisCounter other) { int otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from other newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } int otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new IntegerAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative()); } }
public LongAnalysisCounter merge(LongAnalysisCounter other) { long otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from other newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } long otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new LongAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative()); } }
public LongAnalysisCounter merge(LongAnalysisCounter other) { long otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from other newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } long otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new LongAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative()); } }
public IntegerAnalysisCounter merge(IntegerAnalysisCounter other) { int otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from other newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } int otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new IntegerAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative()); } }
public DoubleAnalysisCounter merge(DoubleAnalysisCounter other) { double otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from othergetSampleStdDev newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } double otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new DoubleAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative(), countNaN + other.getCountNaN()); } }
public DoubleAnalysisCounter merge(DoubleAnalysisCounter other) { double otherMin = other.getMinValueSeen(); long newCountMinValue; if (getMinValueSeen() == otherMin) { newCountMinValue = countMinValue + other.getCountMinValue(); } else if (getMinValueSeen() > otherMin) { //Keep other, take count from othergetSampleStdDev newCountMinValue = other.getCountMinValue(); } else { //Keep this min, no change to count newCountMinValue = countMinValue; } double otherMax = other.getMaxValueSeen(); long newCountMaxValue; if (getMaxValueSeen() == otherMax) { newCountMaxValue = countMaxValue + other.getCountMaxValue(); } else if (getMaxValueSeen() < otherMax) { //Keep other, take count from other newCountMaxValue = other.getCountMaxValue(); } else { //Keep this max, no change to count newCountMaxValue = countMaxValue; } return new DoubleAnalysisCounter(counter.merge(other.getCounter()), countZero + other.getCountZero(), newCountMinValue, newCountMaxValue, countPositive + other.getCountPositive(), countNegative + other.getCountNegative(), countNaN + other.getCountNaN()); } }