Package org.iq80.leveldb

Examples of org.iq80.leveldb.DBIterator.peekNext()


        String keyBuffer = null;
        try {
            String prefix = getRepositoryNameCompleted() + '\0';

            for (it.seek(keyBuilder(getRepositoryNameCompleted(), "")); it.hasNext(); it.next()) {
                keyBuffer = asString(it.peekNext().getKey());

                if (!keyBuffer.startsWith(prefix)) {
                    break;
                }
                String exchangeId = keyBuffer.substring(prefix.length());
View Full Code Here


        String prefix = repositoryName + '\0';
        int count = 0;
        try {
            for (it.seek(keyBuilder(repositoryName, "")); it.hasNext(); it.next()) {
                if (!asString(it.peekNext().getKey()).startsWith(prefix)) {
                    break;
                }
                count++;
            }
        } finally {
View Full Code Here

       
        List<String> keysToDeleteList = new ArrayList<>();
       
        DBIterator iterator = db.iterator();
    iterator.seek(bytes(liveStatsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(liveStatsBucketKey + accountName)) {
      String key = asString(iterator.peekNext().getKey());
      BasicMetricHour metricHour = gson.fromJson(asString(iterator.next().getValue()), BasicMetricHour.class);
      if (metricHour.getHoursSince1970() <= toHoursSince1970) {
        keysToDeleteList.add(key);
      }
View Full Code Here

        List<String> keysToDeleteList = new ArrayList<>();
       
        DBIterator iterator = db.iterator();
    iterator.seek(bytes(liveStatsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(liveStatsBucketKey + accountName)) {
      String key = asString(iterator.peekNext().getKey());
      BasicMetricHour metricHour = gson.fromJson(asString(iterator.next().getValue()), BasicMetricHour.class);
      if (metricHour.getHoursSince1970() <= toHoursSince1970) {
        keysToDeleteList.add(key);
      }
     
View Full Code Here

  public void deleteLiveStatisticsBetween(String guiPath, String accountName, Long fromTimeperiod, Long toTimeperiod) {
        List<String> keysToDeleteList = new ArrayList<>();
       
        DBIterator iterator = db.iterator();
    iterator.seek(bytes(liveStatsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(liveStatsBucketKey + accountName)) {
      String key = asString(iterator.peekNext().getKey());
      BasicMetricHour metricHour = gson.fromJson(asString(iterator.next().getValue()), BasicMetricHour.class);
      if (metricHour.getHoursSince1970() >= fromTimeperiod && metricHour.getHoursSince1970() <= toTimeperiod) {
        keysToDeleteList.add(key);
      }
View Full Code Here

        List<String> keysToDeleteList = new ArrayList<>();
       
        DBIterator iterator = db.iterator();
    iterator.seek(bytes(liveStatsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(liveStatsBucketKey + accountName)) {
      String key = asString(iterator.peekNext().getKey());
      BasicMetricHour metricHour = gson.fromJson(asString(iterator.next().getValue()), BasicMetricHour.class);
      if (metricHour.getHoursSince1970() >= fromTimeperiod && metricHour.getHoursSince1970() <= toTimeperiod) {
        keysToDeleteList.add(key);
      }
     
View Full Code Here

  public List<Statistics> getTreeMenu(String accountName) {
    List<Statistics> statList = new ArrayList<>();
   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(statsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(statsBucketKey + accountName)) {
      BasicStatistics stat = gson.fromJson(asString(iterator.next().getValue()), BasicStatistics.class);
      statList.add(stat);
    }
   
    return statList;
View Full Code Here

    Hashtable<String, AlertEvaluation> alertEvaluationHash = new Hashtable<>();

    //Fetch any account already in the new queue and add the new AlertEvaluations to the new queue
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(alertEvaluationQueueBucketKey + ";new"));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(alertEvaluationQueueBucketKey + ";new")) {
      BasicAlertEvaluation alertEvaluation = new Gson().fromJson(asString(iterator.next().getValue()), BasicAlertEvaluation.class);
      alertEvaluationHash.put(alertEvaluation.getAccountName(), alertEvaluation);
    }
   
    //Add only the new AlertEvaluations to the new queue
View Full Code Here

  public synchronized String getNextAccountToEvaluateAndMarkAsEvaluating() {
    BasicAlertEvaluation nextAccount = null;
   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(alertEvaluationQueueBucketKey + ";new"));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(alertEvaluationQueueBucketKey + ";new")) {
      BasicAlertEvaluation alertEvaluation = new Gson().fromJson(asString(iterator.next().getValue()), BasicAlertEvaluation.class);
      nextAccount = alertEvaluation;
      break;
    }
   
View Full Code Here

  public List<GroupedStatistics> getGroupedStatistics(String accountName) {
    List<GroupedStatistics> groupedStatsList = new ArrayList<>();
   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(groupedStatsBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(groupedStatsBucketKey + accountName)) {
      BasicGroupedStatistics groupedStat = gson.fromJson(asString(iterator.next().getValue()), BasicGroupedStatistics.class);
      groupedStatsList.add(groupedStat);
    }
   
    return groupedStatsList;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.