public BytesAnalysisCounter merge(BytesAnalysisCounter other) { return new BytesAnalysisCounter(countTotal + other.countTotal); }
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()); } }
case Integer: IntegerAnalysisCounter iac = (IntegerAnalysisCounter) counters.get(i); IntegerAnalysis ia = new IntegerAnalysis.Builder().min(iac.getMinValueSeen()) .max(iac.getMaxValueSeen()).mean(iac.getMean()).sampleStdev(iac.getSampleStdev()) .sampleVariance(iac.getSampleVariance()).countZero(iac.getCountZero()) .countNegative(iac.getCountNegative()).countPositive(iac.getCountPositive()) .countMinValue(iac.getCountMinValue()).countMaxValue(iac.getCountMaxValue()) .countTotal(iac.getCountTotal()).build(); list.add(ia); minsMaxes[i][0] = iac.getMinValueSeen(); minsMaxes[i][1] = iac.getMaxValueSeen(); LongAnalysis la = new LongAnalysis.Builder().min(lac.getMinValueSeen()).max(lac.getMaxValueSeen()) .mean(lac.getMean()).sampleStdev(lac.getSampleStdev()) .sampleVariance(lac.getSampleVariance()).countZero(lac.getCountZero()) .countNegative(lac.getCountNegative()).countPositive(lac.getCountPositive()) .countMinValue(lac.getCountMinValue()).countMaxValue(lac.getCountMaxValue()) .countTotal(lac.getCountTotal()).build(); minsMaxes[i][0] = lac.getMinValueSeen(); minsMaxes[i][1] = lac.getMaxValueSeen(); DoubleAnalysis da = new DoubleAnalysis.Builder().min(dac.getMinValueSeen()) .max(dac.getMaxValueSeen()).mean(dac.getMean()).sampleStdev(dac.getSampleStdev()) .sampleVariance(dac.getSampleVariance()).countZero(dac.getCountZero()) .countNegative(dac.getCountNegative()).countPositive(dac.getCountPositive()) .countMinValue(dac.getCountMinValue()).countMaxValue(dac.getCountMaxValue()) .countNaN(dac.getCountNaN()).countTotal(dac.getCountTotal()).build();
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()); } }
break; case Integer: analysisCounters.add(new IntegerAnalysisCounter()); break; case Long: analysisCounters.add(new LongAnalysisCounter()); break; case Double: analysisCounters.add(new DoubleAnalysisCounter()); break; case Categorical: analysisCounters.add(new CategoricalAnalysisCounter()); break; case Time: analysisCounters.add(new LongAnalysisCounter()); break; case Bytes: analysisCounters.add(new BytesAnalysisCounter()); break; case NDArray: analysisCounters.add(new NDArrayAnalysisCounter()); break; default:
@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; }
case Integer: IntegerAnalysisCounter iac = (IntegerAnalysisCounter) counters.get(i); IntegerAnalysis ia = new IntegerAnalysis.Builder().min(iac.getMinValueSeen()) .max(iac.getMaxValueSeen()).mean(iac.getMean()).sampleStdev(iac.getSampleStdev()) .sampleVariance(iac.getSampleVariance()).countZero(iac.getCountZero()) .countNegative(iac.getCountNegative()).countPositive(iac.getCountPositive()) .countMinValue(iac.getCountMinValue()).countMaxValue(iac.getCountMaxValue()) .countTotal(iac.getCountTotal()).build(); list.add(ia); minsMaxes[i][0] = iac.getMinValueSeen(); minsMaxes[i][1] = iac.getMaxValueSeen(); LongAnalysis la = new LongAnalysis.Builder().min(lac.getMinValueSeen()).max(lac.getMaxValueSeen()) .mean(lac.getMean()).sampleStdev(lac.getSampleStdev()) .sampleVariance(lac.getSampleVariance()).countZero(lac.getCountZero()) .countNegative(lac.getCountNegative()).countPositive(lac.getCountPositive()) .countMinValue(lac.getCountMinValue()).countMaxValue(lac.getCountMaxValue()) .countTotal(lac.getCountTotal()).build(); minsMaxes[i][0] = lac.getMinValueSeen(); minsMaxes[i][1] = lac.getMaxValueSeen(); DoubleAnalysis da = new DoubleAnalysis.Builder().min(dac.getMinValueSeen()) .max(dac.getMaxValueSeen()).mean(dac.getMean()).sampleStdev(dac.getSampleStdev()) .sampleVariance(dac.getSampleVariance()).countZero(dac.getCountZero()) .countNegative(dac.getCountNegative()).countPositive(dac.getCountPositive()) .countMinValue(dac.getCountMinValue()).countMaxValue(dac.getCountMaxValue()) .countNaN(dac.getCountNaN()).countTotal(dac.getCountTotal()).build();
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 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()); } }
break; case Integer: analysisCounters.add(new IntegerAnalysisCounter()); break; case Long: analysisCounters.add(new LongAnalysisCounter()); break; case Double: analysisCounters.add(new DoubleAnalysisCounter()); break; case Categorical: analysisCounters.add(new CategoricalAnalysisCounter()); break; case Time: analysisCounters.add(new LongAnalysisCounter()); break; case Bytes: analysisCounters.add(new BytesAnalysisCounter()); break; case NDArray: analysisCounters.add(new NDArrayAnalysisCounter()); break; default:
@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; }
public BytesAnalysisCounter merge(BytesAnalysisCounter other) { return new BytesAnalysisCounter(countTotal + other.countTotal); }