com.datastax.driver.core.Row.getByte()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中com.datastax.driver.core.Row.getByte方法的一些代码示例,展示了Row.getByte的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getByte方法的具体详情如下:
包路径:com.datastax.driver.core.Row
类名称:Row
方法名:getByte

Row.getByte介绍

[英]Returns the ith value of this row as a byte array.

Note that this method validate that the column is of type BLOB. If you want to retrieve the bytes for any type of columns, use #getBytesUnsafe(int) instead.
[中]以字节数组的形式返回此行的第i个值。
请注意,此方法验证列是否为BLOB类型。如果要检索任何类型列的字节,请改用#getBytesUnsafe(int)。

代码示例

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public byte getByte(String s)
{
  return row.getByte(s);
}

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public byte getByte(int i)
{
  return row.getByte(i);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public byte getByte(int i)
{
  return row.getByte(i);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public byte getByte(String s)
{
  return row.getByte(s);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public byte getByte(int i)
{
  return row.getByte(i);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public byte getByte(String s)
{
  return row.getByte(s);
}

代码示例来源:origin: locationtech/geowave

@Override
public int getNumberOfDuplicates() {
 return row.getByte(CassandraField.GW_NUM_DUPLICATES_KEY.getFieldName());
}

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

public Func1<Row, Boolean> typeFilter(MetricType<?> type, int index) {
  return row -> {
    MetricType<?> metricType = MetricType.fromCode(row.getByte(index));
    return (type == null && metricType.isUserType()) || metricType == type;
  };
}

代码示例来源:origin: hawkular/hawkular-metrics

public Func1<Row, Boolean> typeFilter(MetricType<?> type, int index) {
  return row -> {
    MetricType<?> metricType = MetricType.fromCode(row.getByte(index));
    return (type == null && metricType.isUserType()) || metricType == type;
  };
}

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

@Override
  public Observable<MetricId<T>> call(Observable<Row> rows) {
    return rows.filter(row -> {
      MetricType<?> metricType = MetricType.fromCode(row.getByte(1));
      return (type == null && metricType.isUserType()) || metricType == type;
    }).map(row1 -> {
      @SuppressWarnings("unchecked")
      MetricType<T> metricType = (MetricType<T>) MetricType.fromCode(row1.getByte(1));
      return new MetricId<>(row1.getString(0), metricType, row1.getString(2));
    });
  }
}

代码示例来源:origin: hawkular/hawkular-metrics

@Override
  public Observable<MetricId<T>> call(Observable<Row> rows) {
    return rows.filter(row -> {
      MetricType<?> metricType = MetricType.fromCode(row.getByte(1));
      return (type == null && metricType.isUserType()) || metricType == type;
    }).map(row1 -> {
      @SuppressWarnings("unchecked")
      MetricType<T> metricType = (MetricType<T>) MetricType.fromCode(row1.getByte(1));
      return new MetricId<>(row1.getString(0), metricType, row1.getString(2));
    });
  }
}

代码示例来源:origin: hawkular/hawkular-metrics

@Override
  public Observable<MetricId<?>> call(Observable<Row> rows) {
    return rows.map(row -> new MetricId<>(row.getString(0), MetricType.fromCode(row.getByte(1)),
        row.getString(2)));
  }
}

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

@Override
  public Observable<MetricId<?>> call(Observable<Row> rows) {
    return rows.map(row -> new MetricId<>(row.getString(0), MetricType.fromCode(row.getByte(1)),
        row.getString(2)));
  }
}

代码示例来源:origin: hawkular/hawkular-metrics

@Override
public <T> Observable<Metric<T>> scanAllMetricIndexes() {
  return dataAccess.scanMetricsInMetricsIndex()
      .flatMap(r -> r)
      .flatMap(r -> {
        MetricId<T> metricId =
            new MetricId(r.getString(0), MetricType.fromCode(r.getByte(1)),
                r.getString(2));
        Metric<T> metric = new Metric<>(metricId, r.getMap(3, String.class, String.class));
        return Observable.just(metric);
      });
}

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

@Override
public <T> Observable<Metric<T>> scanAllMetricIndexes() {
  return dataAccess.scanMetricsInMetricsIndex()
      .flatMap(r -> r)
      .flatMap(r -> {
        MetricId<T> metricId =
            new MetricId(r.getString(0), MetricType.fromCode(r.getByte(1)),
                r.getString(2));
        Metric<T> metric = new Metric<>(metricId, r.getMap(3, String.class, String.class));
        return Observable.just(metric);
      });
}

代码示例来源:origin: hawkular/hawkular-metrics

/**
 * This method is currently unused.
 */
public Observable<JobDetails> findScheduledJobs(Date timeSlice, rx.Scheduler scheduler) {
  return session.executeAndFetch(findAllScheduled.bind(), scheduler)
      .filter(filterNullJobs)
      .filter(row -> row.getTimestamp(0).compareTo(timeSlice) <= 0)
      .map(row -> createJobDetails(
          row.getUUID(1),
          row.getString(2),
          row.getString(3),
          row.getMap(4, String.class, String.class),
          getTrigger(row.getUDTValue(5)),
          JobStatus.fromCode(row.getByte(6)),
          timeSlice))
      .collect(HashMap::new, (Map<UUID, SortedSet<JobDetails>> map, JobDetails details) -> {
        SortedSet<JobDetails> set = map.get(details.getJobId());
        if (set == null) {
          set = new TreeSet<>((JobDetails d1, JobDetails d2) ->
              Long.compare(d1.getTrigger().getTriggerTime(), d2.getTrigger().getTriggerTime()));
        }
        set.add(details);
        map.put(details.getJobId(), set);
      })
      .flatMap(map -> Observable.from(map.entrySet()))
      .map(entry -> entry.getValue().first());
}

代码示例来源:origin: hawkular/hawkular-metrics

public Observable<ScheduledExecution> findScheduledExecutions(UUID jobId, rx.Scheduler scheduler) {
  return session.executeAndFetch(findAllScheduled.bind(), scheduler)
      .filter(filterNullJobs)
      .filter(row -> row.getUUID(1).equals(jobId))
      .map(row -> new ScheduledExecution(row.getTimestamp(0), createJobDetails(
          row.getUUID(1),
          row.getString(2),
          row.getString(3),
          row.getMap(4, String.class, String.class),
          getTrigger(row.getUDTValue(5)),
          JobStatus.fromCode(row.getByte(6)),
          row.getTimestamp(0))));
}

代码示例来源:origin: hawkular/hawkular-metrics

public Observable<JobDetailsImpl> findAllScheduledJobs(rx.Scheduler scheduler) {
  return session.executeAndFetch(findAllScheduled.bind(), scheduler)
      .filter(filterNullJobs)
      .map(row -> createJobDetails(
          row.getUUID(1),
          row.getString(2),
          row.getString(3),
          row.getMap(4, String.class, String.class),
          getTrigger(row.getUDTValue(5)),
          JobStatus.fromCode(row.getByte(6)),
          row.getTimestamp(0)));
}

代码示例来源:origin: hawkular/hawkular-metrics

public Observable<JobDetailsImpl> findScheduledJobsForTime(Date timeSlice, rx.Scheduler scheduler) {
  return session.executeAndFetch(findScheduledForTime.bind(timeSlice), scheduler)
      .filter(filterNullJobs)
      .map(row -> createJobDetails(
          row.getUUID(1),
          row.getString(2),
          row.getString(3),
          row.getMap(4, String.class, String.class),
          getTrigger(row.getUDTValue(5)),
          JobStatus.fromCode(row.getByte(6)),
          timeSlice))
      .doOnSubscribe(() -> logger.debugf("Fetching scheduled jobs tor time slice [%s]", timeSlice))
      .doOnNext(details -> logger.debugf("Found job details %s", details));
}

代码示例来源:origin: sitewhere/sitewhere

/**
 * Load fields from a row into a device event.
 * 
 * @param event
 * @param row
 * @throws SiteWhereException
 */
public static void loadEventFields(DeviceEvent event, Row row) throws SiteWhereException {
event.setDeviceId(row.getUUID(FIELD_DEVICE_ID));
event.setId(row.getUUID(FIELD_EVENT_ID));
event.setAlternateId(row.getString(FIELD_ALTERNATE_ID));
event.setEventType(getEventTypeForIndicator(row.getByte(FIELD_EVENT_TYPE)));
event.setDeviceAssignmentId(row.getUUID(FIELD_ASSIGNMENT_ID));
event.setCustomerId(row.getUUID(FIELD_CUSTOMER_ID));
event.setAreaId(row.getUUID(FIELD_AREA_ID));
event.setAssetId(row.getUUID(FIELD_ASSET_ID));
event.setEventDate(row.getTimestamp(FIELD_EVENT_DATE));
event.setReceivedDate(row.getTimestamp(FIELD_RECEIVED_DATE));
}

相关文章