Package com.datastax.driver.core

Examples of com.datastax.driver.core.BoundStatement


            new RawNumericMetricMapper(), storageSession);
    }

    public List<AggregateNumericMetric> findAggregateMetrics(int scheduleId, Bucket bucket, long startTime,
        long endTime) {
        BoundStatement statement = findAggregateMetricsByDateRange.bind(scheduleId, bucket.toString(),
            new Date(startTime), new Date(endTime));
        ResultSet resultSet = storageSession.execute(statement);
        AggregateNumericMetricMapper mapper = new AggregateNumericMetricMapper();
        return mapper.mapAll(resultSet);
    }
View Full Code Here


        return mapper.mapAll(resultSet);
    }

    public StorageResultSetFuture findAggregateMetricsAsync(int scheduleId, Bucket bucket, long startTime,
        long endTime) {
        BoundStatement statement = findAggregateMetricsByDateRange.bind(scheduleId, bucket.toString(),
            new Date(startTime), new Date(endTime));
        return storageSession.executeAsync(statement);
    }
View Full Code Here

            new Date(startTime), new Date(endTime));
        return storageSession.executeAsync(statement);
    }

    public StorageResultSetFuture findIndexEntries(IndexBucket bucket, int partition, long timestamp) {
        BoundStatement statement = findIndexEntries.bind(bucket.toString(), partition, new Date(timestamp));
        return storageSession.executeAsync(statement);
    }
View Full Code Here

        BoundStatement statement = findIndexEntries.bind(bucket.toString(), partition, new Date(timestamp));
        return storageSession.executeAsync(statement);
    }

    public StorageResultSetFuture findIndexEntries(IndexBucket bucket, int partition, long timestamp, int scheduleId) {
        BoundStatement statement = findIndexEntriesAfterScheduleId.bind(bucket.toString(), partition,
            new Date(timestamp), scheduleId);
        return storageSession.executeAsync(statement);
    }
View Full Code Here

            new Date(timestamp), scheduleId);
        return storageSession.executeAsync(statement);
    }

    public StorageResultSetFuture updateIndex(IndexBucket bucket, long timestamp, int scheduleId) {
        BoundStatement statement = insertIndexEntry.bind(bucket.toString(),
            (scheduleId % configuration.getIndexPartitions()), new Date(timestamp), scheduleId);
        return storageSession.executeAsync(statement);
    }
View Full Code Here

            (scheduleId % configuration.getIndexPartitions()), new Date(timestamp), scheduleId);
        return storageSession.executeAsync(statement);
    }

    public StorageResultSetFuture deleteIndexEntry(IndexEntry indexEntry) {
        BoundStatement statement = deleteIndexEntry.bind(indexEntry.getBucket().toString(), indexEntry.getPartition(),
            new Date(indexEntry.getTimestamp()), indexEntry.getScheduleId());
        return storageSession.executeAsync(statement);
    }
View Full Code Here

            new Date(indexEntry.getTimestamp()), indexEntry.getScheduleId());
        return storageSession.executeAsync(statement);
    }

    public void deleteAggregate(AggregateNumericMetric metric) {
        BoundStatement statement = deleteAggregate.bind(metric.getScheduleId(), metric.getBucket().toString(),
            new Date(metric.getTimestamp()));
        storageSession.execute(statement);
    }
View Full Code Here

            "SELECT schedule_id, time, type, value " +
            "FROM " + MetricsTable.AGGREGATE + " " +
            "WHERE schedule_id = ? AND bucket = ? " +
            "ORDER BY time, type";
        PreparedStatement statement = session.prepare(cql);
        BoundStatement boundStatement = statement.bind(scheduleId, bucket.toString());

        return new SimplePagedResult<AggregateNumericMetric>(boundStatement, new AggregateNumericMetricMapper(),
            storageSession);
    }
View Full Code Here

    }

    private void updateIndex(String oldBucket, String newBucket, DateTime startDay, DateTime start, DateTime end,
        Duration timeSlice) {
        DateTime time = start;
        BoundStatement statement = find412IndexEntries.bind(oldBucket, startDay.toDate(), start.toDate());
        ResultSet resultSet = session.execute(statement);
        DateTime day = startDay;
        int startScheduleId = 0;
        int count = 0;
        int partition = 0;
View Full Code Here

        updateIndex("twenty_four_hour_metrics", "six_hour", start, end, Days.ONE.toStandardDuration());
    }

    private void updateIndex(String oldBucket, String newBucket, DateTime start, DateTime end, Duration timeSlice) {
        DateTime time = start;
        BoundStatement statement = find411IndexEntries.bind(oldBucket, start.toDate());
        ResultSet resultSet = session.execute(statement);
        int count = 0;
        int scheduleId = 0;
        int partition = 0;
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.BoundStatement

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.