Package edu.brown.hstore.Hstoreservice

Examples of edu.brown.hstore.Hstoreservice.Status


    public static final String m_jarFileName = "dedupe.jar";

    class AsyncCallback implements ProcedureCallback {
        @Override
        public void clientCallback(ClientResponse clientResponse) {
            final Status status = clientResponse.getStatus();
            incrementTransactionCounter(clientResponse, 0);

            if (status != Status.OK) {
                System.err.println("Failed to execute!!!");
                System.err.println(clientResponse.getException());
View Full Code Here


     * @param txn_idx
     */
    protected final void incrementTransactionCounter(final ClientResponse cresponse, final int txn_idx) {
        // Only include it if it wasn't rejected
        // This is actually handled in the Distributer, but it doesn't hurt to have this here
        Status status = cresponse.getStatus();
        if (status == Status.OK || status == Status.ABORT_USER) {
           
            // TRANSACTION COUNTERS
            boolean is_specexec = cresponse.isSpeculative();
            boolean is_dtxn = (cresponse.isSinglePartition() == false);
            synchronized (m_txnStats.transactions) {
                m_txnStats.transactions.put(txn_idx);
                if (is_dtxn) m_txnStats.dtxns.put(txn_idx);
                if (is_specexec) m_txnStats.specexecs.put(txn_idx);
            } // SYNCH

            // LATENCIES COUNTERS
            // Ignore zero latencies... Not sure why this happens...
            int latency = cresponse.getClusterRoundtrip();
            if (latency > 0) {
                Map<Integer, ObjectHistogram<Integer>> latenciesMap = (is_dtxn ? m_txnStats.dtxnLatencies :
                                                                                 m_txnStats.spLatencies);
                Histogram<Integer> latencies = latenciesMap.get(txn_idx);
                if (latencies == null) {
                    synchronized (latenciesMap) {
                        latencies = latenciesMap.get(txn_idx);
                        if (latencies == null) {
                            latencies = new ObjectHistogram<Integer>();
                            latenciesMap.put(txn_idx, (ObjectHistogram<Integer>)latencies);
                        }
                    } // SYNCH
                }
                synchronized (latencies) {
                    latencies.put(latency);
                } // SYNCH
            }
           
            // RESPONSE ENTRIES
            if (m_enableResponseEntries) {
                long timestamp = System.currentTimeMillis();
                m_responseEntries.add(cresponse, m_id, txn_idx, timestamp);
            }
           
            // BASE PARTITIONS
            if (m_txnStats.isBasePartitionsEnabled()) {
                synchronized (m_txnStats.basePartitions) {
                    m_txnStats.basePartitions.put(cresponse.getBasePartition());
                } // SYNCH
            }
        }
//        else if (status == Status.ABORT_UNEXPECTED) {
//            LOG.warn("Invalid " + m_countDisplayNames[txn_idx] + " response!\n" + cresponse);
//            if (cresponse.getException() != null) {
//                cresponse.getException().printStackTrace();
//            }
//            if (cresponse.getStatusString() != null) {
//                LOG.warn(cresponse.getStatusString());
//            }
//        }
       
        if (m_txnStats.isResponsesStatusesEnabled()) {
            synchronized (m_txnStats.responseStatuses) {
                m_txnStats.responseStatuses.put(status.ordinal());   
            } // SYNCH
        }
    }
View Full Code Here

     */
    protected boolean checkTransaction(String procName,
                                       ClientResponse clientResponse,
                                       boolean abortExpected,
                                       boolean errorExpected) {
        final Status status = clientResponse.getStatus();
        if (status != Status.OK) {
            if (errorExpected)
                return true;

            if (abortExpected && status == Status.ABORT_USER)
View Full Code Here

                assert(expected == arr.length()) :
                    String.format("%d != %d", expected, arr.length());
            expected = arr.length();
        } // FOR
       
        Status statuses[] = Status.values();
        for (int i = 0; i < expected; i++) {
            Entry e = new Entry();
            int col = 0;
            e.timestamp = jsonArrays[col++].getLong(i);
            e.clientId = jsonArrays[col++].getInt(i);
View Full Code Here

            int swap_index = (cur_index + 1) % NUM_REQUEUE_LISTS;
           
            // if (hstore_conf.site.profiling) this.profiler.cleanup.start();
            boolean needsSleep = true;
            for (int i = 0; i < this.statuses.length; i++) {
                Status status = this.statuses[i];
                Queue<Long> queue = this.deletables[i];
                Collection<Long> swap_queue = this.requeues[swap_index][i];
                if (swap_queue.isEmpty() == false) {
                    queue.addAll(swap_queue);
                    swap_queue.clear();
View Full Code Here

       
        // -------------------------------
        // PROCESS RESPONSE AND FIGURE OUT NEXT STEP
        // -------------------------------
       
        Status status = cresponse.getStatus();
        if (debug.val) {
            LOG.debug(String.format("%s - Finished execution of transaction control code " +
                                    "[status=%s, beforeMode=%s, currentMode=%s]",
                                    ts, status, before_mode, this.currentExecMode));
            if (ts.hasPendingError()) {
View Full Code Here

            ts.initRound(this.partitionId, undoToken);
            ts.startRound(this.partitionId);
        }
       
        DependencySet result = null;
        Status status = Status.OK;
        SerializableException error = null;
       
        // Check how many fragments are not marked as ignored
        // If the fragment is marked as ignore then it means that it was already
        // sent to this partition for prefetching. We need to make sure that we remove
View Full Code Here

     */
    protected void processClientResponse(LocalTransaction ts, ClientResponseImpl cresponse) {
        // IMPORTANT: If we executed this locally and only touched our partition, then we need to commit/abort right here
        // 2010-11-14: The reason why we can do this is because we will just ignore the commit
        // message when it shows from the Dtxn.Coordinator. We should probably double check with Evan on this...
        Status status = cresponse.getStatus();

        if (debug.val) {
            LOG.debug(String.format("%s - Processing ClientResponse at partition %d " +
                      "[status=%s, singlePartition=%s, local=%s, clientHandle=%d]",
                      ts, this.partitionId, status, ts.isPredictSinglePartition(),
View Full Code Here

        assert(ts.isInitialized()) :
            String.format("Trying to prepare uninitialized transaction %s at partition %d", ts, this.partitionId);
        assert(ts.isMarkedFinished(this.partitionId) == false) :
            String.format("Trying to prepare %s again after it was already finished at partition %d", ts, this.partitionId);
       
        Status status = Status.OK;
       
        // Skip if we've already invoked prepared for this txn at this partition
        if (ts.isMarkedPrepared(this.partitionId) == false) {
            if (debug.val)
                LOG.debug(String.format("%s - Preparing to commit txn at partition %d [specBlocked=%d]",
View Full Code Here

                LOG.warn("Got back null ClientResponse. Ignoring...");
                return;
            }
           
            final Long clientHandle = new Long(response.getClientHandle());
            final Status status = response.getStatus();
            final long now = System.currentTimeMillis();
            CallbackValues stuff = null;
            synchronized (this) {
                stuff = m_callbacks.remove(clientHandle);
                if (stuff != null) {
View Full Code Here

TOP

Related Classes of edu.brown.hstore.Hstoreservice.Status

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.