Examples of Batch


Examples of ch.hortis.sonar.core.Batch

    } catch ( NamingException ex ) {
      ctxEvent.getServletContext().log( "Naming exception occured during java:comp/env/sonar lookups", ex );
    }

    if ( url != null && driver != null && password != null && username != null ) {
      batch = new Batch( url, driver, username, password );
    } else if ( jdbcDialect != null ) {
      batch = new Batch( datasource, jdbcDialect );
    } else {
      ctxEvent.getServletContext().log( "Missing JDBC settings" );
    }

    if ( batch != null ) {
View Full Code Here

Examples of co.cask.cdap.api.annotation.Batch

  /**
   * Returns the user specify batch size or {@code null} if not specified.
   */
  private Integer getBatchSize(Method method) {
    // Determine queue batch size, if any
    Batch batch = method.getAnnotation(Batch.class);
    if (batch != null) {
      int batchSize = batch.value();
      Preconditions.checkArgument(batchSize > 0, "Batch size should be > 0: %s", method.getName());
      return batchSize;
    }
    return null;
  }
View Full Code Here

Examples of co.cask.tigon.api.annotation.Batch

  /**
   * Returns the user specify batch size or {@code null} if not specified.
   */
  private Integer getBatchSize(Method method) {
    // Determine queue batch size, if any
    Batch batch = method.getAnnotation(Batch.class);
    if (batch != null) {
      int batchSize = batch.value();
      Preconditions.checkArgument(batchSize > 0, "Batch size should be > 0: %s", method.getName());
      return batchSize;
    }
    return null;
  }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Batch

            LOG.debug("{} => {}", description.getName(), gson.toJson(spec, BatchSpec.class));
        }
    }

    private BatchSpec toSpec(Class<? extends BatchDescription> description) {
        Batch info = description.getAnnotation(Batch.class);
        String batchId = getEnvironment().getConfiguration().getBatchId();
        if (info == null) {
            LOG.warn(MessageFormat.format(
                    "Failed to extract \"@{0}\": {1}",
                    Batch.class.getName(),
                    description.getName()));
            return new BatchSpec(batchId);
        } else {
            String comment = normalizeComment(info.comment());
            boolean strict = info.strict();
            List<Parameter> parameters = toParameters(description, info.parameters());
            return new BatchSpec(info.name(), comment, strict, parameters);
        }
    }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Batch

    public List<String> getDiagnostics() {
        return diagnostics;
    }

    private void analyze() {
        Batch config = findConfig();
        BatchDescription instance = describe();
        if (hasError()) {
            return;
        }
        this.batchClass = new BatchClass(config, instance);
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Batch

            error(null, "バッチクラスはpublicで宣言する必要があります");
        }
        if (Modifier.isAbstract(description.getModifiers())) {
            error(null, "バッチクラスはabstractで宣言できません");
        }
        Batch conf = description.getAnnotation(Batch.class);
        if (conf == null) {
            error(null, "バッチクラスには@Batch注釈の付与が必要です");
        }
        return conf;
    }
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.Batch

    Camera camera = viewport.getCamera();
    camera.update();

    if (!root.isVisible()) return;

    Batch batch = this.batch;
    if (batch != null) {
      batch.setProjectionMatrix(camera.combined);
      batch.begin();
      root.draw(batch, 1);
      batch.end();
    }

    if (debug) drawDebug();
  }
View Full Code Here

Examples of com.datastax.driver.core.querybuilder.Batch

     * @param key The key value that will receive the data
     * @throws Throwable
     */
    private void testWideBatchRows(CCMBridge.CCMCluster c, int key) throws Throwable {
        // Write data
        Batch q = batch();
        for (int i = 0; i < 10000; ++i) {
            q = q.add(insertInto("wide_batch_rows").value("k", key).value("i", i));
        }
        c.session.execute(q.setConsistencyLevel(ConsistencyLevel.QUORUM));

        // Read data
        ResultSet rs = c.session.execute(select("i").from("wide_batch_rows").where(eq("k", key)));

        // Verify data
View Full Code Here

Examples of com.datastax.driver.core.querybuilder.Batch

        }
    }

    private void insertDataToCassandra(List<Object[]> existingData) throws Exception {
        List<ResultSetFuture> resultSetFutures = new ArrayList<ResultSetFuture>();
        Batch batch = QueryBuilder.batch();
        int batchSize = 0;

        //only need approximate TTL to speed up processing
        //given that each batch is processed within seconds, getting the
        //system time once per batch has minimal impact on the record retention
        long creationTimeMillis;
        long itemTTLSeconds;
        long currentTimeMillis = System.currentTimeMillis();
        long expectedTTLMillis = MigrationTable.RAW.getTTLinMilliseconds();

        for (Object[] rawDataPoint : existingData) {
            creationTimeMillis = Long.parseLong(rawDataPoint[MigrationQuery.TIMESTAMP_INDEX].toString());
            itemTTLSeconds = (expectedTTLMillis - currentTimeMillis + creationTimeMillis) / 1000l;

            if (itemTTLSeconds > 0) {
                int scheduleId = Integer.parseInt(rawDataPoint[MigrationQuery.SCHEDULE_INDEX].toString());
                Date creationTime = new Date(creationTimeMillis);

                batch.add(QueryBuilder.insertInto(MetricsTable.RAW.toString()).value("schedule_id", scheduleId)
                    .value("time", creationTime)
                    .value("value", Double.parseDouble(rawDataPoint[MigrationQuery.VALUE_INDEX].toString()))
                    .using(ttl((int) itemTTLSeconds)));
                batchSize++;
View Full Code Here

Examples of com.datastax.driver.core.querybuilder.Batch

        return telemetry;
    }

    private void insertDataToCassandra(List<Object[]> existingData) throws Exception {
        List<ResultSetFuture> resultSetFutures = new ArrayList<ResultSetFuture>();
        Batch batch = QueryBuilder.batch();
        int batchSize = 0;

        //only need approximate TTL to speed up processing
        //given that each batch is processed within seconds, getting the
        //system time once per batch has minimal impact on the record retention
        long creationTimeMillis;
        long itemTTLSeconds;
        long currentTimeMillis = System.currentTimeMillis();
        long expectedTTLMillis = migrationTable.getTTLinMilliseconds();

        for (Object[] rawMeasurement : existingData) {
            creationTimeMillis = Long.parseLong(rawMeasurement[MigrationQuery.TIMESTAMP_INDEX].toString());
            itemTTLSeconds = (expectedTTLMillis - currentTimeMillis + creationTimeMillis) / 1000l;

            if (itemTTLSeconds > 0) {
                int scheduleId = Integer.parseInt(rawMeasurement[MigrationQuery.SCHEDULE_INDEX].toString());
                Date time = new Date(creationTimeMillis);

                batch.add(QueryBuilder.insertInto(MetricsTable.AGGREGATE.toString())
                    .value("schedule_id", scheduleId)
                    .value("bucket", migrationTable.getMigrationBucket().toString())
                    .value("time", time)
                    .value("avg", Double.parseDouble(rawMeasurement[MigrationQuery.VALUE_INDEX].toString()))
                    .value("min", Double.parseDouble(rawMeasurement[MigrationQuery.MIN_VALUE_INDEX].toString()))
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.