Package com.qspin.qtaste.datacollection

Examples of com.qspin.qtaste.datacollection.Data


        reason = null;
    }

    public void dataReceived(long timestamp, String sender, String dest, String name, Object value, Data.DataSource source, Object type) {
        // logger.debug("CacheImpl: dataReceived got " + name + " value:" + value);
        hash.put(name, new Data(timestamp, sender, dest, name, value, source, type));
    }
View Full Code Here


        System.out.println("Dumping the Cache (Cache contains " + hash.size() + " entries)");
        System.out.println("Timestamp of the clear history: " + t0 + " (" + new Date(t0) + ")");
        while (i.hasNext()) {
            NameValue<String, Data> nameValue = i.next();
            //if (!inBlackList(nameValue.name)) {
            Data entry = nameValue.value;
            System.out.println("name:" + nameValue.name + " value:" + entry.getValue() + " timestamp:" + (entry.getTimestamp() - t0));
        //}
        }
        System.out.println("End of dump (Cache contains " + hash.size() + " entries)");
    }
View Full Code Here

    public Data getLast(String name) throws QTasteException, QTasteTestFailException {
        if (!isValid) {
            throw new QTasteException("Cache is not valid. Reason:" + reason);
        }
        Data data = hash.getLast(name);
        if (data == null) {
            throw new QTasteTestFailException("Variable " + name + " is not present in cache");
        }
        return data;
    }
View Full Code Here

        }

        do {
            Object lastValue;
            try {
                Data lastData = getLast(name);
                lastValue = lastData.getValue();
                int comparisonResult = ((Comparable) value).compareTo(lastValue);
                boolean comparisonSuccessful = false;
                switch (comparator) {
                    case COMPARATOR_EQ:
                        comparisonSuccessful = comparisonResult == 0;
View Full Code Here

        boolean hasPreparedData = false;

        while (!interrupted && iCacheValues.hasNext()) {
            NameValue<String,Data> nameValue = iCacheValues.next();
            String name = nameValue.name;
            Data value = nameValue.value;

            // get timestamp
            long cacheValueTimestamp = value.getTimestamp();
           
            // break out of loop if "till" timestamp is reached
            if (cacheValueTimestamp >= tillTimestamp) {
                iCacheValues.previous();
                break;
            }

            // correct timestamp reference           
            cacheValueTimestamp += (startTimestamp - hash.getClearHistoryTimestamp());
            value.setTimestamp(cacheValueTimestamp);

            if (previousCacheValueTimestamp == 0) {
                previousCacheValueTimestamp = cacheValueTimestamp;
            }
            if (cacheValueTimestamp == previousCacheValueTimestamp) {
View Full Code Here

    }

    public void publish() {
        //logger.info("publish"); 
        Iterator<Data> i = array.iterator();
        Data data = null;
        DataReceivedListener listener = CacheImpl.getInstance();
        while (i.hasNext()) {
            data = i.next();
            listener.dataReceived(data.getTimestamp(), data.getSender(), data.getDest(), data.getName(), data.getValue(), data.getSource(), data.getType());
            //logger.debug("Publishing " + data.getName() + " timestamp " + data.getTimestamp());      
        }
        array.clear();
     }
View Full Code Here

TOP

Related Classes of com.qspin.qtaste.datacollection.Data

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.