Package org.voltdb.exceptions

Examples of org.voltdb.exceptions.SerializableException


        public void shutdownPrepare(RpcController controller, ShutdownPrepareRequest request, RpcCallback<ShutdownPrepareResponse> done) {
            String originName = HStoreThreadManager.formatSiteName(request.getSenderSite());
           
            // See if they gave us the original error. If they did, then we'll
            // try to be helpful and print it out here
            SerializableException error = null;
            if (request.hasError() && request.getError().isEmpty() == false) {
                error = SerializableException.deserializeFromBuffer(request.getError().asReadOnlyByteBuffer());
            }
            LOG.warn(String.format("Got %s from %s [hasError=%s]%s",
                     request.getClass().getSimpleName(), originName, (error != null),
View Full Code Here


            RpcCallback<ShutdownPrepareResponse> callback = new ShutdownPrepareCallback(this.num_sites, latch);
            ShutdownPrepareRequest.Builder builder = ShutdownPrepareRequest.newBuilder()
                                                        .setSenderSite(this.catalog_site.getId());
            // Pack the error into a SerializableException
            if (error != null) {
                SerializableException sError = new SerializableException(error);
                ByteBuffer buffer = sError.serializeToBuffer();
                buffer.rewind();
                builder.setError(ByteString.copyFrom(buffer));
                if (debug.val)
                    LOG.debug("Serializing error message in shutdown request");
            }
View Full Code Here

        if (debug.val)
            LOG.debug(String.format("%s got hit with a %s! " +
                      "Going to clean-up our mess and re-execute [restarts=%d]",
                      orig_ts , status, orig_ts.getRestartCounter()));
        int base_partition = orig_ts.getBasePartition();
        SerializableException orig_error = orig_ts.getPendingError();

        //LOG.info("In transactionRestart()");
               
        // If this txn has been restarted too many times, then we'll just give up
        // and reject it outright
View Full Code Here

        if (result.getStatus() != Status.OK) {
            if (trace.val)
                LOG.trace(String.format("Received non-success response %s from partition %d for %s",
                          result.getStatus(), result.getPartitionId(), ts));

            SerializableException error = null;
            if (needs_profiling) ts.profiler.startDeserialization();
            try {
                ByteBuffer buffer = result.getError().asReadOnlyByteBuffer();
                error = SerializableException.deserializeFromBuffer(buffer);
            } catch (Exception ex) {
View Full Code Here

            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
        // it from the list of fragmentIds that we need to execute.
        int fragmentCount = fragment.getFragmentIdCount();
        for (int i = 0; i < fragmentCount; i++) {
            if (fragment.getStmtIgnore(i)) {
                fragmentCount--;
            }
        } // FOR
        final ParameterSet parameters[] = tmp_fragmentParams.getParameterSet(fragmentCount);
        assert(parameters.length == fragmentCount);
       
        // Construct data given to the EE to execute this work fragment
        this.tmp_EEdependencies.clear();
        long fragmentIds[] = tmp_fragmentIds.getArray(fragmentCount);
        int fragmentOffsets[] = tmp_fragmentOffsets.getArray(fragmentCount);
        int outputDepIds[] = tmp_outputDepIds.getArray(fragmentCount);
        int inputDepIds[] = tmp_inputDepIds.getArray(fragmentCount);
        int offset = 0;

        for (int i = 0, cnt = fragment.getFragmentIdCount(); i < cnt; i++) {
            if (fragment.getStmtIgnore(i) == false) {
                fragmentIds[offset] = fragment.getFragmentId(i);
                fragmentOffsets[offset] = i;
                outputDepIds[offset] = fragment.getOutputDepId(i);
                inputDepIds[offset] = fragment.getInputDepId(i);
                parameters[offset] = allParameters[fragment.getParamIndex(i)];
                this.getFragmentInputs(ts, inputDepIds[offset], this.tmp_EEdependencies);
               
                if (trace.val && ts.isSysProc() == false && is_basepartition == false)
                    LOG.trace(String.format("%s - Offset:%d FragmentId:%d OutputDep:%d/%d InputDep:%d/%d",
                              ts, offset, fragmentIds[offset],
                              outputDepIds[offset], fragment.getOutputDepId(i),
                              inputDepIds[offset], fragment.getInputDepId(i)));
                offset++;
            }
        } // FOR
        assert(offset == fragmentCount);
       
        try {
            result = this.executeFragmentIds(ts,
                                             ts.getLastUndoToken(this.partitionId),
                                             fragmentIds,
                                             parameters,
                                             outputDepIds,
                                             inputDepIds,
                                             this.tmp_EEdependencies);
        } catch (EvictedTupleAccessException ex) {
            // XXX: What do we do if this is not a single-partition txn?
            status = Status.ABORT_EVICTEDACCESS;
            error = ex;
        } catch (ConstraintFailureException ex) {
          LOG.info("Found the abort!!!"+ex);
            status = Status.ABORT_UNEXPECTED;
            error = ex;
        } catch (SQLException ex) {
          LOG.info("Found the abort!!!"+ex);
            status = Status.ABORT_UNEXPECTED;
            error = ex;
        } catch (EEException ex) {
            // this.crash(ex);
          LOG.info("Found the abort!!!"+ex);
            status = Status.ABORT_UNEXPECTED;
            error = ex;
        } catch (Throwable ex) {
          LOG.info("Found the abort!!!"+ex);
            status = Status.ABORT_UNEXPECTED;
            if (ex instanceof SerializableException) {
                error = (SerializableException)ex;
            } else {
                error = new SerializableException(ex);
            }
        } finally {
            if (error != null) {
                // error.printStackTrace();
//              if (error instanceof EvictedTupleAccessException){
//                EvictedTupleAccessException ex = (EvictedTupleAccessException) error;
//              }
             
                LOG.warn(String.format("%s - Unexpected %s on partition %d",
                         ts, error.getClass().getSimpleName(), this.partitionId),
                         error); // (debug.val ? error : null));
            }
            // Success, but without any results???
            if (result == null && status == Status.OK) {
                String msg = String.format("The WorkFragment %s executed successfully on Partition %d but " +
                                           "result is null for %s",
                                           fragment.getFragmentIdList(), this.partitionId, ts);
                Exception ex = new Exception(msg);
                if (debug.val) LOG.warn(ex);
                LOG.info("Found the abort!!!"+ex);
                status = Status.ABORT_UNEXPECTED;
                error = new SerializableException(ex);
            }
        }
       
        // For single-partition INSERT/UPDATE/DELETE queries, we don't directly
        // execute the SendPlanNode in order to get back the number of tuples that
View Full Code Here

        if (exceptionLength == 0) {
            throw new EEException(errorCode);
        } else {
            exceptionBuffer.position(0);
            exceptionBuffer.limit(4 + exceptionLength);
            SerializableException ex = null;
            try {
                ex = SerializableException.deserializeFromBuffer(exceptionBuffer);
            } catch (Throwable e) {
                ex = new SerializableException();
                e.printStackTrace();
            }
            throw ex;
        }
    }
View Full Code Here

            throw new RuntimeException(errorMsg);
        } catch (Throwable ex) {
            error = ex;
        }
        assertNotNull(error);
        SerializableException sError = new SerializableException(error);
        ByteBuffer buffer = sError.serializeToBuffer();
        buffer.rewind();
       
        ShutdownPrepareRequest.Builder builder = ShutdownPrepareRequest.newBuilder()
                                                        .setSenderSite(0)
                                                        .setError(ByteString.copyFrom(buffer));
        ShutdownPrepareRequest request = builder.build();
       
        assertTrue(request.hasError());
        buffer = request.getError().asReadOnlyByteBuffer();
        SerializableException clone = SerializableException.deserializeFromBuffer(buffer);
        assertTrue(clone.getMessage(), clone.getMessage().contains(errorMsg));
    }
View Full Code Here

                // TestMidRejoinDeath ignores acks to trigger the watchdog
                if (StreamSnapshotDataTarget.m_rejoinDeathTestMode && (m_msgFactory.getAckTargetId(msg) == 1)) {
                    continue;
                }

                SerializableException se = m_msgFactory.getException(msg);
                if (se != null) {
                    m_lastException = se;
                    rejoinLog.error("Received exception in ack receiver", se);
                    return;
                }
View Full Code Here

                        e);
            }
            catch (final VoltAbortException e) {
                currentFragResponse.setStatus(
                        FragmentResponseMessage.USER_ERROR,
                        new SerializableException(CoreUtils.throwableToString(e)));
                break;
            }
        }
        return currentFragResponse;
    }
View Full Code Here

TOP

Related Classes of org.voltdb.exceptions.SerializableException

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.