Package gov.nasa.arc.mct.api.feed

Examples of gov.nasa.arc.mct.api.feed.DataArchive


     * Asynchronously putting data into the data buffer.
     */
    @Override
    public void putData(String feedID, TimeUnit timeUnit, Map<Long, Map<String, String>> entries) {
        PERF_LOGGER.debug("Queue size {}", queue.size());
        DataArchive db = this.dataArchives.get(0);
        try {
            db.putData(feedID, timeUnit, entries);
        } catch (BufferFullException e) {
            LOGGER.error("Memory buffer should not be full", e);
        }
        PutDataTask task = new PutDataTask(feedID, timeUnit, entries);
        numOfWriteJobs.incrementAndGet();
View Full Code Here


    @Override
    public void putData(final Map<String, Map<Long, Map<String, String>>> value, final TimeUnit timeUnit,
            final Runnable callback) {
        PERF_LOGGER.debug("Queue size {}", queue.size());
        if (!value.isEmpty()) {
            DataArchive db = this.dataArchives.get(0);
            try {
                db.putData(value, timeUnit, null);
            } catch (BufferFullException e) {
                LOGGER.error("Memory buffer should not be full", e);
            }
            if (dataArchives.size() == 1) {
                callback.run();
            } else {
                Runnable bulkInsert = new Runnable() {
                    public void run() {
                        try {
                            for (Iterator<DataArchive> it = dataArchives.iterator(); it.hasNext();) {
                                DataArchive dataArchive = it.next();
                                if (dataArchive.getLOS() == LOS.fast) {
                                    continue;
                                }
                                try {
                                    if (it.hasNext()) {
                                        dataArchive.putData(value, timeUnit, null);
                                    } else {
                                        dataArchive.putData(value, timeUnit, callback);
                                    }
                                } catch (BufferFullException e) {
                                    dormantArchive = dataArchive;
                                    it.remove();
                                    bufferFullAlert(e.getMessage());
View Full Code Here

        @Override
        public void run() {
            try {
                if (dataArchives.size() > 1) {
                    for (Iterator<DataArchive> it = dataArchives.iterator(); it.hasNext();) {
                        DataArchive dataArchive = it.next();
                        if (dataArchive.getLOS() == LOS.fast) {
                            continue;
                        }
                        try {
                            dataArchive.putData(feedID, timeUnit, entries);
                        } catch (BufferFullException e) {
                            dormantArchive = dataArchive;
                            it.remove();
                            bufferFullAlert(e.getMessage());
                        }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.api.feed.DataArchive

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.