Package gov.nasa.arc.mct.buffer.disk.internal

Examples of gov.nasa.arc.mct.buffer.disk.internal.PartitionTimestamps


    public boolean isCurrentPartition() {
        return this.currentPartition;
    }

    public void updateTimestamp(String feedID, long startTime, long endTime) {
        PartitionTimestamps ts = timestamps.get(feedID);
        if (ts == null) {
            timestamps.put(feedID, new PartitionTimestamps(startTime,endTime));
        } else {
            ts.merge(startTime,endTime);
        }
    }
View Full Code Here


            ts.merge(startTime,endTime);
        }
    }
   
    public void updateTimestamp(String feedID, PartitionTimestamps originalTs) {
        PartitionTimestamps ts = timestamps.get(feedID);
        if (ts == null) {
            timestamps.put(feedID, originalTs);
        } else {
            ts.merge(originalTs);
        }
    }
View Full Code Here

    public void reset() {
        timestamps.clear();
    }
   
    public long getStartTimestamp(String feedID) {
        PartitionTimestamps ts = timestamps.get(feedID);
        if (ts != null) {
            return ts.getStartTimestamp();
        }
        return -1;
    }
View Full Code Here

        }
        return -1;
    }

    public long getEndTimestamp(String feedID) {
        PartitionTimestamps ts = timestamps.get(feedID);
        if (ts != null) {
            return ts.getEndTimestamp();
        }
        return -1;
    }
View Full Code Here

        }
        return -1;
    }

    public boolean isWithinTimeSpan(String feedID, long startTime, long endTime) {
        PartitionTimestamps timeStamp = timestamps.get(feedID);
        if(timeStamp == null) {
            return false;
        }
        long start = timeStamp.getStartTimestamp();
        long end = timeStamp.getEndTimestamp();
        return (startTime <= end || end == -1) && endTime >= start;
    }
View Full Code Here

        long end = timeStamp.getEndTimestamp();
        return (startTime <= end || end == -1) && endTime >= start;
    }

    public boolean isFullyWithinTimeSpan(String feedID, long startTime) {
        PartitionTimestamps timeStamp = timestamps.get(feedID);
        if (timeStamp == null) {
            return false;
        }
       
        if (startTime >= timeStamp.getStartTimestamp()) {
            return true;
        }

        return false;
    }
View Full Code Here

    }

    public void updateTimestamp(Map<String, PartitionTimestamps> ts) {
        for (Entry<String, PartitionTimestamps> entry : ts.entrySet()) {
            String feedID = entry.getKey();
            PartitionTimestamps newTS = entry.getValue();
            PartitionTimestamps timeStamp = timestamps.get(feedID);
            if (timeStamp == null) {
                timestamps.put(feedID, newTS.clone());
                continue;
            }
            timeStamp.merge(newTS);
        }
    }
View Full Code Here

                    }
                    Map<String, String> clonedFeedData = new HashMap<String, String>(feedData.getValue());
                    cachedFeedData.put(time, clonedFeedData);
                }
            }
            timestamps.put(feedID, new PartitionTimestamps(smallestTime, largestTime));
        }
       
       
        timer.stopInterval();
        WRITE_PERF_LOGGER.debug("Time to write {} feeds: {} from partition " + this.env.getCurrentBufferPartition(), value.size(), timer.getIntervalInMillis());
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.buffer.disk.internal.PartitionTimestamps

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.