Package com.inadco.hbl.math.aggregators

Examples of com.inadco.hbl.math.aggregators.IrregularSamplingSummarizer


    private final DataByteArray m_result;

    public ExpAvgNew(String initStr) throws IOException {
        super();
        IrregularSamplingSummarizer sum = PigSummarizerHelper.createSummarizer(initStr, false);
        DataOutputBuffer dob = new DataOutputBuffer();
        PigSummarizerHelper.ser2bytes(sum, dob);
        m_result = new DataByteArray(dob.getData(), 0, dob.getLength());

    }
View Full Code Here


       
    }

    @Override
    public DataByteArray exec(Tuple input) throws IOException {
        IrregularSamplingSummarizer result = null;
        for (Object obj : input.getAll()) {
            if ( obj == null ) continue; // one of arguments is null, ignore
           
            byte[] bytes = DataType.toBytes(obj);
            m_dib.reset(bytes, bytes.length);
            IrregularSamplingSummarizer sum =
                PigSummarizerHelper.bytes2ser(result == null ? m_summarizer1 : m_summarizer2, m_dib);
            if (result == null)
                result = sum;
            else
                result.combine(sum);
View Full Code Here

        Double tNow = input.size() > 1 ? DataType.toDouble(input.get(1)) : null;

        if (bytes == null)
            return null;
        m_dib.reset(bytes, bytes.length);
        IrregularSamplingSummarizer sum = PigSummarizerHelper.bytes2ser(m_summarizer, m_dib);
        return sum == null ? null : (tNow == null ? sum.getValue() : sum.getValueNow(tNow));
    }
View Full Code Here

        DataBag db = DataType.toBag(bag.get(0));
        for (Tuple t : db) {
            byte[] dba = DataType.toBytes(t.get(0));
            dib.reset(dba, dba.length);
            IrregularSamplingSummarizer sum = PigSummarizerHelper.bytes2ser(buffer, dib);
            if (summarizer == null) {
                summarizer = PigSummarizerHelper.createSummarizer(summarizerInitStr, true);
                summarizer.assign(sum);
            } else
                summarizer.combine(sum);
View Full Code Here

TOP

Related Classes of com.inadco.hbl.math.aggregators.IrregularSamplingSummarizer

Copyright © 2018 www.massapicom. 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.