Package org.voltdb.exceptions

Examples of org.voltdb.exceptions.ServerFaultException


                          ts, ts, ts.getClientResponse().getStatus()));
            try {
                this.processClientResponse(ts, ts.getClientResponse());
            } catch (Throwable ex) {
                String msg = "Failed to complete queued response for " + ts;
                throw new ServerFaultException(msg, ex, ts.getTransactionId());
            }
        } // FOR
    }
View Full Code Here


        Map<Integer, DependencyInfo> stmt_deps = state.prefetch_dependencies.get(stmtCounter);
        if (stmt_deps == null) {
            String msg = String.format("Unexpected prefetch result for %s from partition %d - " +
                                       "Invalid SQLStmt index '%d'",
                                       ts, partitionId, stmtCounter);
            throw new ServerFaultException(msg, ts.getTransactionId());
        }
       
        DependencyInfo dinfo = stmt_deps.get(fragmentId);
        if (dinfo == null) {
            String msg = String.format("Unexpected prefetch result for %s from partition %d - " +
                                       "Invalid PlanFragment id '%d'",
                                       ts, partitionId, fragmentId);
            throw new ServerFaultException(msg, ts.getTransactionId());
        }
        assert(dinfo.getParameterSetHash() == paramsHash) :
            String.format("%s - ParameterSet Mismatch in %s for %s [%d != %d]",
                          ts, dinfo, TransactionUtil.debugStmtFrag(stmtCounter, fragmentId),
                          dinfo.getParameterSetHash(), paramsHash);
View Full Code Here

            // Aggregate Results
            case AGGREGATE_ID:
                List<VoltTable> siteResults = dependencies.get(DISTRIBUTE_ID);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                Pair<Integer, SortDirectionType> sortCol = Pair.of(3, SortDirectionType.ASC);
                @SuppressWarnings("unchecked")
                VoltTable vt = VoltTableUtil.sort(VoltTableUtil.union(siteResults), sortCol);
                result = new DependencySet(AGGREGATE_ID, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
        return (result);
    }
View Full Code Here

            // ----------------------------------------------------------------------------
            case AGGREGATE_ID: {
                List<VoltTable> siteResults = dependencies.get(DISTRIBUTE_ID);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                Pair<Integer, SortDirectionType> sortCol = Pair.of(3, SortDirectionType.ASC);
                @SuppressWarnings("unchecked")
                VoltTable vt = VoltTableUtil.sort(VoltTableUtil.union(siteResults), sortCol);
                result = new DependencySet(AGGREGATE_ID, vt);
                break;
            }
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
        return (result);
    }
View Full Code Here

            case SysProcFragmentId.PF_gcAggregate:
                LOG.debug("Combining results");
                List<VoltTable> siteResults = dependencies.get(SysProcFragmentId.PF_gcDistribute);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
               
                VoltTable vt = VoltTableUtil.union(siteResults);
                result = new DependencySet(SysProcFragmentId.PF_gcAggregate, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
        // Invalid!
        return (result);
    }
View Full Code Here

            // Aggregate Results
            case SysProcFragmentId.PF_quiesceAggregate:
                List<VoltTable> siteResults = dependencies.get(SysProcFragmentId.PF_quiesceDistribute);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
                VoltTable vt = VoltTableUtil.union(siteResults);
                result = new DependencySet(SysProcFragmentId.PF_quiesceAggregate, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
        // Invalid!
        return (result);
    }
View Full Code Here

                    assert(result.getRowCount() >= 0);
                }
                else {
                    String msg = String.format("Unexpected execution of SysProc #%d on partition %d",
                                               fragmentId, this.partitionId);
                    throw new ServerFaultException(msg, txn_id);
                }
                return new DependencySet(fragmentId, result);
            }
            // ----------------------------------------------------------------------------
            // PROFILER DATA AGGREGATION
            // ----------------------------------------------------------------------------
            case SysProcFragmentId.PF_nodeMemoryAggregator:
            case SysProcFragmentId.PF_txnCounterAggregator:
            case SysProcFragmentId.PF_txnProfilerAggregator:
            case SysProcFragmentId.PF_execProfilerAggregator:
            case SysProcFragmentId.PF_queueProfilerAggregator:
            case SysProcFragmentId.PF_markovProfilerAggregator:
            case SysProcFragmentId.PF_specexecProfilerAggregator:
            case SysProcFragmentId.PF_siteProfilerAggregator:
            case SysProcFragmentId.PF_plannerProfilerAggregator:
            case SysProcFragmentId.PF_anticacheProfilerAggregator: {
                // Do a reverse look up to find the input dependency id
                int dataFragmentId = -1;
                for (Integer id : STATS_DATA.keySet()) {
                    Pair<SysProcSelector, Integer> pair = STATS_DATA.get(id);
                    if (pair.getSecond().equals(fragmentId)) {
                        dataFragmentId = id.intValue();
                        break;
                    }
                } // FOR
                if (dataFragmentId == -1) {
                    String msg = "Failed to find input data dependency for SysProc #" + fragmentId;
                    throw new ServerFaultException(msg, txn_id);
                }
                VoltTable result = VoltTableUtil.union(dependencies.get(dataFragmentId));
                return new DependencySet(fragmentId, result);
            }
           
View Full Code Here

        } catch (SerializableException ex) {
            throw ex;
        // We know that any error that we get here is because of us and not their user code
        } catch (Throwable ex) {
            String message = "Unexpected error while executing queries";
            throw new ServerFaultException(message, ex, this.localTxnState.getTransactionId());
        }

        // Workload Trace - Stop Query
        if (this.workloadTraceEnable && this.workloadTxnHandle != null) {
            for (int i = 0; i < this.batchQueryStmtIndex; i++) {
View Full Code Here

            throw ex;
        } catch (SerializableException ex) {
            throw ex;
        } catch (Throwable ex) {
            ex.printStackTrace();
            throw new ServerFaultException("Unexpected error", ex, localTxnState.getTransactionId());
        } finally {
            this.batchId++;
            if (localTxnState.hasPendingError()) {
                throw localTxnState.getPendingError();
            }
View Full Code Here

            // Aggregate Results
            case AGGREGATE_ID:
                List<VoltTable> siteResults = dependencies.get(DISTRIBUTE_ID);
                if (siteResults == null || siteResults.isEmpty()) {
                    String msg = "Missing site results";
                    throw new ServerFaultException(msg, txn_id);
                }
                if (debug.val)
                    LOG.debug("# of Results: " + siteResults.size() + "\n" +
                              StringUtil.join("\n************\n", siteResults));
               
                // Make sure that everyone is the same value
                VoltTable vt = new VoltTable(aggregateResultsColumns);
                TimestampType timestamp = new TimestampType();
                Set<String> values = new HashSet<String>();
                for (int i = 0; i < confNames.length; i++) {
                    if (i > 0) values.clear();
                    for (VoltTable site_vt : siteResults) {
                        if (i > 0) site_vt.resetRowPosition();
                        while (site_vt.advanceRow()) {
                            if (site_vt.getString(1).equalsIgnoreCase(confNames[i])) {
                                values.add(site_vt.getString(2));
                                break;
                            }
                        } // WHILE
                    } // FOR (site results)
                    if (values.isEmpty()) {
                        String msg = "Failed to find updated configuration values for '" + confNames[i] + "'";
                        throw new VoltAbortException(msg);
                    }
                    else if (values.size() > 1) {
                        String msg = String.format("Unexpected multiple values for '%s': %s",
                                                   confNames[i], values);
                        throw new VoltAbortException(msg);
                    }
                    vt.addRow(confNames[i], CollectionUtil.first(values).toString(), timestamp);
                } // FOR
                result = new DependencySet(AGGREGATE_ID, vt);
                break;
            default:
                String msg = "Unexpected sysproc fragmentId '" + fragmentId + "'";
                throw new ServerFaultException(msg, txn_id);
        } // SWITCH
        // Invalid!
        return (result);
    }
View Full Code Here

TOP

Related Classes of org.voltdb.exceptions.ServerFaultException

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.