Package com.comcast.cmb.common.util

Examples of com.comcast.cmb.common.util.PersistenceException


          CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
        }
      }
      OperationResult<Void> result = m.execute();
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
    }
  }
View Full Code Here


      }
      OperationResult<Void> result = m.execute();
    } catch (NotFoundException ex){
      //ignore.
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
    }
View Full Code Here

      }
      OperationResult<Void> result = m.execute();
    } catch (NotFoundException ex){
      //ignore.
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
    }
  }
View Full Code Here

      return count;
    } catch (NotFoundException ex){
      //ignore.
      return 0;
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraRead, 1L);
    }
View Full Code Here

      getKeyspace(keyspace).
        prepareColumnMutation(getColumnFamily(columnFamily), rowKey, columnName).
        incrementCounterColumn(incrementBy).
        execute();
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
    }
View Full Code Here

    try {
      getKeyspace(keyspace).prepareColumnMutation(getColumnFamily(columnFamily), rowKey, columnName)
        .incrementCounterColumn(-decrementBy)
        .execute();
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
    }
View Full Code Here

    try {
      getKeyspace(keyspace).
        prepareColumnMutation(getColumnFamily(columnFamily),rowKey,columnName).
        deleteCounterColumn().execute();
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
    }
View Full Code Here

    } catch (NotFoundException ex){
      //ignore. This might happen when C* data expired.
      return null;
    }
    catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
      long ts2 = System.currentTimeMillis();
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraTime, (ts2 - ts1));
      CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraRead, 1L);
    }
View Full Code Here

  @Override
  public String sendMessage(CQSQueue queue, int shard, CQSMessage message) throws PersistenceException, IOException, InterruptedException, NoSuchAlgorithmException, JSONException {
   
    if (queue == null) {
      throw new PersistenceException(CQSErrorCodes.NonExistentQueue, "The supplied queue does not exist");
    }
   
    if (message == null) {
      throw new PersistenceException(CQSErrorCodes.InvalidMessageContents, "The supplied message is invalid");
    }
   
    int delaySeconds = 0;
   
    if (message.getAttributes().containsKey(CQSConstants.DELAY_SECONDS)) {
View Full Code Here

    CQSMessage m = new CQSMessage();
   
    try {
      queue = CQSCache.getCachedQueue(queueUrl);
    } catch (Exception ex) {
      throw new PersistenceException(ex);
    }
   
    if (queue == null) {
      throw new PersistenceException(CMBErrorCodes.InternalError, "Unknown queue " + queueUrl);
    }
   
    JSONObject json = new JSONObject((String)column.getValue());

    m.setMessageId(json.getString("MessageId"));
View Full Code Here

TOP

Related Classes of com.comcast.cmb.common.util.PersistenceException

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.