Package com.basho.riak.client.bucket

Examples of com.basho.riak.client.bucket.Bucket.store()


                storedMetricHour = new BasicMetricHour(guiPath, accountName, hoursSince1970, valueType.toString(), unitType.toString());
            }

            storedMetricHour.addStatistic(new BasicLiveStatistics(guiPath, accountName, timeperiod, valueDouble, valueType.value(), unitType.value(), count));

            myBucket.store("" + guiPath, storedMetricHour).execute();
        } catch (RiakRetryFailedException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
    }
View Full Code Here


  @Override
  public void persistGroupInstrumentation(GroupedStatistics groupedStatistics) {
    Bucket myBucket = null;
        try {
            myBucket = riakClient.fetchBucket("Grouped Statistics;" + groupedStatistics.getAccountName()).execute();
            myBucket.store(groupedStatistics.getName(), groupedStatistics).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }

  }
View Full Code Here

 
  public static <E> void persistObjectInBucket(IRiakClient riakClient, String bucketName, String key, E type) {
    Bucket bucket = null;
    try {
      bucket = riakClient.fetchBucket(bucketName).execute();
      bucket.store(key, type).execute();
    } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
  }
 
View Full Code Here

    @Override
    public void persistAlert(Alert alert) {
        Bucket myBucket = null;
        try {
            myBucket = riakClient.fetchBucket("Alert;" + alert.getAccountName()).execute();
            myBucket.store(alert.getAlertName(), alert).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
    }
View Full Code Here

    @Override
    public void persistTriggeredAlert(TriggeredAlert triggeredAlert) {
        Bucket myBucket = null;
        try {
            myBucket = riakClient.fetchBucket("Triggered_Alert;" + triggeredAlert.getAccountName()).execute();
            myBucket.store(triggeredAlert.getAlertName() + ";" + triggeredAlert.getTimeperiod(), triggeredAlert).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
    }
View Full Code Here

  @Override
  public void persistAccount(Account account) {
    Bucket myBucket = null;
        try {
            myBucket = riakClient.fetchBucket("Account").execute();
            myBucket.store(this.encodeUri(account.getId()), account).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
  }
View Full Code Here

  @Override
  public void persistUser(User user) {
    Bucket myBucket = null;
        try {
            myBucket = riakClient.fetchBucket("User;" + this.encodeUri(user.getUserName())).execute();
            myBucket.store(this.encodeUri(user.getAccountName()), new BasicUser(user)).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }   
  }
View Full Code Here

  public void persistSession(Session session) {
    logger.info("persisting session: " + session.getUuid());
    Bucket myBucket = null;
        try {
          myBucket = riakClient.fetchBucket("Session").execute();
          myBucket.store(this.encodeUri(session.getUuid()), new BasicSession(session)).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
  }
 
View Full Code Here

  @Override
  public void persistAccessToken(AccessToken accessToken) {
    Bucket myBucket = null;
        try {
          myBucket = riakClient.fetchBucket("AccessToken").execute();
          myBucket.store(this.encodeUri(accessToken.getId()), new BasicAccessToken(accessToken)).execute();
        } catch (RiakRetryFailedException rrfe) {
            rrfe.printStackTrace();
        }
  }
 
View Full Code Here

    public void run() {
        for (BasicMetricHour metricHour : metricHourList) {
            Bucket mhBucket = null;
            try {
                mhBucket = riakClient.fetchBucket(metricHour.getAccountName() + ";" + metricHour.getHoursSince1970()).execute();
                mhBucket.store("" + metricHour.getGuiPath(), metricHour).execute();
            } catch (RiakRetryFailedException rrfe) {
                rrfe.printStackTrace();
            }
        }
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.