Java Code Examples for com.datastax.driver.core.Row#getDouble()

The following examples show how to use com.datastax.driver.core.Row#getDouble() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VideoUtil.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
public static void recUpdateRecording(ResultSet results, VideoRecording recording) throws Exception {
   for (Row row : results) {
      double ts = row.getDouble(0);
      long bo = row.getLong(1);
      ByteBuffer bl = row.getBytes(2);

      if (ts == VideoConstants.REC_TS_END) {
         if (bo == RecordingTableField.DURATION.bo()) {
            recording.duration = todouble(bl);
         } else if (bo == RecordingTableField.SIZE.bo()) {
            recording.size = tolong(bl);
         } else {
            logger.warn("unknown end metadata for recording: {}", bo);
         }
      } else {
         recording.iframes.add(new VideoIFrame(ts,bo,tolong(bl)));
      }
   }
}
 
Example 2
Source File: SyntheticResultDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public List<SyntheticResultRollup0> readLastFromRollup0(String agentRollupId,
        String syntheticMonitorId, int x) throws Exception {
    BoundStatement boundStatement = readLastFromRollup0.bind();
    int i = 0;
    boundStatement.setString(i++, agentRollupId);
    boundStatement.setString(i++, syntheticMonitorId);
    boundStatement.setInt(i++, x);
    ResultSet results = session.read(boundStatement);
    List<SyntheticResultRollup0> syntheticResults = new ArrayList<>();
    for (Row row : results) {
        i = 0;
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        double totalDurationNanos = row.getDouble(i++);
        ByteBuffer errorIntervalsBytes = row.getBytes(i++);
        syntheticResults.add(ImmutableSyntheticResultRollup0.builder()
                .captureTime(captureTime)
                .totalDurationNanos(totalDurationNanos)
                .error(errorIntervalsBytes != null)
                .build());
    }
    return syntheticResults;
}
 
Example 3
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
private ListenableFuture<?> rollupServiceCallsFromRows(RollupParams rollup,
        AggregateQuery query, Iterable<Row> rows) throws Exception {
    ServiceCallCollector collector =
            new ServiceCallCollector(rollup.maxServiceCallAggregatesPerTransactionAggregate());
    for (Row row : rows) {
        int i = 0;
        String serviceCallType = checkNotNull(row.getString(i++));
        String serviceCallText = checkNotNull(row.getString(i++));
        double totalDurationNanos = row.getDouble(i++);
        long executionCount = row.getLong(i++);
        collector.mergeServiceCall(serviceCallType, serviceCallText, totalDurationNanos,
                executionCount);
    }
    return insertServiceCalls(collector.getSortedAndTruncatedServiceCalls(),
            rollup.rollupLevel(), rollup.agentRollupId(), query.transactionType(),
            query.transactionName(), query.to(), rollup.adjustedTTL());
}
 
Example 4
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
private ListenableFuture<?> rollupQueriesFromRows(RollupParams rollup, AggregateQuery query,
        Iterable<Row> rows) throws Exception {
    QueryCollector collector =
            new QueryCollector(rollup.maxQueryAggregatesPerTransactionAggregate());
    for (Row row : rows) {
        int i = 0;
        String queryType = checkNotNull(row.getString(i++));
        String truncatedText = checkNotNull(row.getString(i++));
        // full_query_text_sha1 cannot be null since it is used in clustering key
        String fullTextSha1 = Strings.emptyToNull(row.getString(i++));
        double totalDurationNanos = row.getDouble(i++);
        long executionCount = row.getLong(i++);
        boolean hasTotalRows = !row.isNull(i);
        long totalRows = row.getLong(i++);
        collector.mergeQuery(queryType, truncatedText, fullTextSha1, totalDurationNanos,
                executionCount, hasTotalRows, totalRows);
    }
    return insertQueries(collector.getSortedAndTruncatedQueries(), rollup.rollupLevel(),
            rollup.agentRollupId(), query.transactionType(), query.transactionName(),
            query.to(), rollup.adjustedTTL());
}
 
Example 5
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
private ListenableFuture<?> rollupOverallSummaryFromRows(RollupParams rollup,
        AggregateQuery query, Iterable<Row> rows) throws Exception {
    double totalDurationNanos = 0;
    long transactionCount = 0;
    for (Row row : rows) {
        totalDurationNanos += row.getDouble(0);
        transactionCount += row.getLong(1);
    }
    BoundStatement boundStatement =
            getInsertOverallPS(summaryTable, rollup.rollupLevel()).bind();
    int i = 0;
    boundStatement.setString(i++, rollup.agentRollupId());
    boundStatement.setString(i++, query.transactionType());
    boundStatement.setTimestamp(i++, new Date(query.to()));
    boundStatement.setDouble(i++, totalDurationNanos);
    boundStatement.setLong(i++, transactionCount);
    boundStatement.setInt(i++, rollup.adjustedTTL().generalTTL());
    return session.writeAsync(boundStatement);
}
 
Example 6
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeServiceCallsInto(String agentRollupId, AggregateQuery query,
        ServiceCallCollector collector) throws Exception {
    ResultSet results = executeQuery(agentRollupId, query, serviceCallTable);
    long captureTime = Long.MIN_VALUE;
    for (Row row : results) {
        int i = 0;
        captureTime = Math.max(captureTime, checkNotNull(row.getTimestamp(i++)).getTime());
        String serviceCallType = checkNotNull(row.getString(i++));
        String serviceCallText = checkNotNull(row.getString(i++));
        double totalDurationNanos = row.getDouble(i++);
        long executionCount = row.getLong(i++);
        collector.mergeServiceCall(serviceCallType, serviceCallText, totalDurationNanos,
                executionCount);
        collector.updateLastCaptureTime(captureTime);
    }
}
 
Example 7
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeQueriesInto(String agentRollupId, AggregateQuery query,
        QueryCollector collector) throws Exception {
    ResultSet results = executeQuery(agentRollupId, query, queryTable);
    long captureTime = Long.MIN_VALUE;
    for (Row row : results) {
        int i = 0;
        captureTime = Math.max(captureTime, checkNotNull(row.getTimestamp(i++)).getTime());
        String queryType = checkNotNull(row.getString(i++));
        String truncatedText = checkNotNull(row.getString(i++));
        // full_query_text_sha1 cannot be null since it is used in clustering key
        String fullTextSha1 = Strings.emptyToNull(row.getString(i++));
        double totalDurationNanos = row.getDouble(i++);
        long executionCount = row.getLong(i++);
        boolean hasTotalRows = !row.isNull(i);
        long totalRows = row.getLong(i++);
        collector.mergeQuery(queryType, truncatedText, fullTextSha1, totalDurationNanos,
                executionCount, hasTotalRows, totalRows);
        collector.updateLastCaptureTime(captureTime);
    }
}
 
Example 8
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public List<PercentileAggregate> readPercentileAggregates(String agentRollupId,
        AggregateQuery query) throws Exception {
    ResultSet results = executeQuery(agentRollupId, query, histogramTable);
    List<PercentileAggregate> percentileAggregates = new ArrayList<>();
    for (Row row : results) {
        int i = 0;
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        double totalDurationNanos = row.getDouble(i++);
        long transactionCount = row.getLong(i++);
        ByteBuffer bytes = checkNotNull(row.getBytes(i++));
        Aggregate.Histogram durationNanosHistogram = Aggregate.Histogram.parseFrom(bytes);
        percentileAggregates.add(ImmutablePercentileAggregate.builder()
                .captureTime(captureTime)
                .totalDurationNanos(totalDurationNanos)
                .transactionCount(transactionCount)
                .durationNanosHistogram(durationNanosHistogram)
                .build());
    }
    return percentileAggregates;
}
 
Example 9
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public void mergeTransactionNameSummariesInto(String agentRollupId, SummaryQuery query,
        SummarySortOrder sortOrder, int limit, TransactionNameSummaryCollector collector)
        throws Exception {
    // currently have to do group by / sort / limit client-side
    BoundStatement boundStatement =
            checkNotNull(readTransactionPS.get(summaryTable)).get(query.rollupLevel()).bind();
    bindQuery(boundStatement, agentRollupId, query);
    ResultSet results = session.read(boundStatement);
    for (Row row : results) {
        int i = 0;
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        String transactionName = checkNotNull(row.getString(i++));
        double totalDurationNanos = row.getDouble(i++);
        long transactionCount = row.getLong(i++);
        collector.collect(transactionName, totalDurationNanos, transactionCount, captureTime);
    }
}
 
Example 10
Source File: ResultImpl.java    From scalardb with Apache License 2.0 6 votes vote down vote up
private static Value convert(Row row, String name, DataType.Name type)
    throws UnsupportedTypeException {
  switch (type) {
    case BOOLEAN:
      return new BooleanValue(name, row.getBool(name));
    case INT:
      return new IntValue(name, row.getInt(name));
    case BIGINT:
      return new BigIntValue(name, row.getLong(name));
    case FLOAT:
      return new FloatValue(name, row.getFloat(name));
    case DOUBLE:
      return new DoubleValue(name, row.getDouble(name));
    case TEXT: // for backwards compatibility
    case VARCHAR:
      return new TextValue(name, row.getString(name));
    case BLOB:
      ByteBuffer buffer = row.getBytes(name);
      return new BlobValue(name, buffer == null ? null : buffer.array());
    default:
      throw new UnsupportedTypeException(type.toString());
  }
}
 
Example 11
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@Override
public void mergeOverallSummaryInto(String agentRollupId, SummaryQuery query,
        OverallSummaryCollector collector) throws Exception {
    // currently have to do aggregation client-site (don't want to require Cassandra 2.2 yet)
    ResultSet results = executeQuery(agentRollupId, query, summaryTable);
    for (Row row : results) {
        int i = 0;
        // results are ordered by capture time so Math.max() is not needed here
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        double totalDurationNanos = row.getDouble(i++);
        long transactionCount = row.getLong(i++);
        collector.mergeSummary(totalDurationNanos, transactionCount, captureTime);
    }
}
 
Example 12
Source File: AggregatePartitionsFunction.java    From iotplatform with Apache License 2.0 5 votes vote down vote up
private Double getDoubleValue(Row row) {
    if (aggregation == Aggregation.MIN || aggregation == Aggregation.MAX
            || aggregation == Aggregation.SUM || aggregation == Aggregation.AVG) {
        return row.getDouble(DOUBLE_POS);
    } else {
        return null;
    }
}
 
Example 13
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 5 votes vote down vote up
private static String mergeRowIntoSummaries(Row row, Map<String, MutableSummary> summaries) {
    int i = 0;
    String transactionName = checkNotNull(row.getString(i++));
    MutableSummary summary = summaries.get(transactionName);
    if (summary == null) {
        summary = new MutableSummary();
        summaries.put(transactionName, summary);
    }
    summary.totalDurationNanos += row.getDouble(i++);
    summary.transactionCount += row.getLong(i++);
    return transactionName;
}
 
Example 14
Source File: GenerateTimeZoneId.java    From arcusplatform with Apache License 2.0 5 votes vote down vote up
public void execute(ExecutionContext context, boolean autoRollback) throws CommandExecutionException {
   Session session = context.getSession();
   PreparedStatement update = session.prepare(UPDATE_PLACE);
   
   ResultSet rs = context.getSession().execute(SELECT);
   for(Row row: rs) {
      UUID placeId = row.getUUID("id");
      String tzName = row.getString("tzName");
      if(StringUtils.isEmpty(tzName)) {
         continue;
      }

      logger.debug("Attmempting to repair timzone [{}]...", tzName);
      Double offset = row.getDouble("tzOffset");
      Boolean usesDst = row.getBool("tzUsesDst");
      
      TimeZone tz;
      try {
         tz = TimeZones.guessTimezone(tzName, offset, usesDst);
      }
      catch(Exception e) {
         logger.warn("Unable to determine timezone for place [{}]", placeId, e);
         continue;
      }

      logger.info("Found timezone [{}] for name [{}]", tz.getID(), tzName);
      BoundStatement bs = update.bind(
            tz.getID(), 
            tzName, 
            TimeZones.getOffsetAsHours(tz.getRawOffset()), 
            tz.useDaylightTime(),
            placeId
      );
      session.execute(bs);
   }
}
 
Example 15
Source File: AggregateDaoImpl.java    From glowroot with Apache License 2.0 4 votes vote down vote up
@Override
public List<OverviewAggregate> readOverviewAggregates(String agentRollupId,
        AggregateQuery query) throws Exception {
    ResultSet results = executeQuery(agentRollupId, query, overviewTable);
    List<OverviewAggregate> overviewAggregates = new ArrayList<>();
    for (Row row : results) {
        int i = 0;
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        double totalDurationNanos = row.getDouble(i++);
        long transactionCount = row.getLong(i++);
        boolean asyncTransactions = row.getBool(i++);
        List<Aggregate.Timer> mainThreadRootTimers =
                Messages.parseDelimitedFrom(row.getBytes(i++), Aggregate.Timer.parser());
        Aggregate.ThreadStats mainThreadStats = Aggregate.ThreadStats.newBuilder()
                .setTotalCpuNanos(getNextThreadStat(row, i++))
                .setTotalBlockedNanos(getNextThreadStat(row, i++))
                .setTotalWaitedNanos(getNextThreadStat(row, i++))
                .setTotalAllocatedBytes(getNextThreadStat(row, i++))
                .build();
        // reading delimited singleton list for backwards compatibility with data written
        // prior to 0.12.0
        List<Aggregate.Timer> list =
                Messages.parseDelimitedFrom(row.getBytes(i++), Aggregate.Timer.parser());
        Aggregate.Timer auxThreadRootTimer = list.isEmpty() ? null : list.get(0);
        Aggregate.ThreadStats auxThreadStats;
        if (auxThreadRootTimer == null) {
            auxThreadStats = null;
            i += 4;
        } else {
            auxThreadStats = Aggregate.ThreadStats.newBuilder()
                    .setTotalCpuNanos(getNextThreadStat(row, i++))
                    .setTotalBlockedNanos(getNextThreadStat(row, i++))
                    .setTotalWaitedNanos(getNextThreadStat(row, i++))
                    .setTotalAllocatedBytes(getNextThreadStat(row, i++))
                    .build();
        }
        List<Aggregate.Timer> asyncTimers =
                Messages.parseDelimitedFrom(row.getBytes(i++), Aggregate.Timer.parser());
        ImmutableOverviewAggregate.Builder builder = ImmutableOverviewAggregate.builder()
                .captureTime(captureTime)
                .totalDurationNanos(totalDurationNanos)
                .transactionCount(transactionCount)
                .asyncTransactions(asyncTransactions)
                .addAllMainThreadRootTimers(mainThreadRootTimers)
                .mainThreadStats(mainThreadStats)
                .auxThreadRootTimer(auxThreadRootTimer)
                .auxThreadStats(auxThreadStats)
                .addAllAsyncTimers(asyncTimers);
        overviewAggregates.add(builder.build());
    }
    return overviewAggregates;
}
 
Example 16
Source File: AbstractCassandraProcessor.java    From localization_nifi with Apache License 2.0 4 votes vote down vote up
protected static Object getCassandraObject(Row row, int i, DataType dataType) {
    if (dataType.equals(DataType.blob())) {
        return row.getBytes(i);

    } else if (dataType.equals(DataType.varint()) || dataType.equals(DataType.decimal())) {
        // Avro can't handle BigDecimal and BigInteger as numbers - it will throw an
        // AvroRuntimeException such as: "Unknown datum type: java.math.BigDecimal: 38"
        return row.getObject(i).toString();

    } else if (dataType.equals(DataType.cboolean())) {
        return row.getBool(i);

    } else if (dataType.equals(DataType.cint())) {
        return row.getInt(i);

    } else if (dataType.equals(DataType.bigint())
            || dataType.equals(DataType.counter())) {
        return row.getLong(i);

    } else if (dataType.equals(DataType.ascii())
            || dataType.equals(DataType.text())
            || dataType.equals(DataType.varchar())) {
        return row.getString(i);

    } else if (dataType.equals(DataType.cfloat())) {
        return row.getFloat(i);

    } else if (dataType.equals(DataType.cdouble())) {
        return row.getDouble(i);

    } else if (dataType.equals(DataType.timestamp())) {
        return row.getTimestamp(i);

    } else if (dataType.equals(DataType.date())) {
        return row.getDate(i);

    } else if (dataType.equals(DataType.time())) {
        return row.getTime(i);

    } else if (dataType.isCollection()) {

        List<DataType> typeArguments = dataType.getTypeArguments();
        if (typeArguments == null || typeArguments.size() == 0) {
            throw new IllegalArgumentException("Column[" + i + "] " + dataType.getName()
                    + " is a collection but no type arguments were specified!");
        }
        // Get the first type argument, to be used for lists and sets (and the first in a map)
        DataType firstArg = typeArguments.get(0);
        TypeCodec firstCodec = codecRegistry.codecFor(firstArg);
        if (dataType.equals(DataType.set(firstArg))) {
            return row.getSet(i, firstCodec.getJavaType());
        } else if (dataType.equals(DataType.list(firstArg))) {
            return row.getList(i, firstCodec.getJavaType());
        } else {
            // Must be an n-arg collection like map
            DataType secondArg = typeArguments.get(1);
            TypeCodec secondCodec = codecRegistry.codecFor(secondArg);
            if (dataType.equals(DataType.map(firstArg, secondArg))) {
                return row.getMap(i, firstCodec.getJavaType(), secondCodec.getJavaType());
            }
        }

    } else {
        // The different types that we support are numbers (int, long, double, float),
        // as well as boolean values and Strings. Since Avro doesn't provide
        // timestamp types, we want to convert those to Strings. So we will cast anything other
        // than numbers or booleans to strings by using the toString() method.
        return row.getObject(i).toString();
    }
    return null;
}
 
Example 17
Source File: SyntheticResultDaoImpl.java    From glowroot with Apache License 2.0 4 votes vote down vote up
@Override
public List<SyntheticResult> readSyntheticResults(String agentRollupId,
        String syntheticMonitorId, long from, long to, int rollupLevel) throws Exception {
    BoundStatement boundStatement = readResultPS.get(rollupLevel).bind();
    int i = 0;
    boundStatement.setString(i++, agentRollupId);
    boundStatement.setString(i++, syntheticMonitorId);
    boundStatement.setTimestamp(i++, new Date(from));
    boundStatement.setTimestamp(i++, new Date(to));
    ResultSet results = session.read(boundStatement);
    List<SyntheticResult> syntheticResults = new ArrayList<>();
    for (Row row : results) {
        i = 0;
        long captureTime = checkNotNull(row.getTimestamp(i++)).getTime();
        double totalDurationNanos = row.getDouble(i++);
        long executionCount = row.getLong(i++);
        ByteBuffer errorIntervalsBytes = row.getBytes(i++);
        List<ErrorInterval> errorIntervals = new ArrayList<>();
        if (errorIntervalsBytes != null) {
            List<Stored.ErrorInterval> storedErrorIntervals = Messages
                    .parseDelimitedFrom(errorIntervalsBytes, Stored.ErrorInterval.parser());
            for (Stored.ErrorInterval storedErrorInterval : storedErrorIntervals) {
                errorIntervals.add(ImmutableErrorInterval.builder()
                        .from(storedErrorInterval.getFrom())
                        .to(storedErrorInterval.getTo())
                        .count(storedErrorInterval.getCount())
                        .message(storedErrorInterval.getMessage())
                        .doNotMergeToTheLeft(storedErrorInterval.getDoNotMergeToTheLeft())
                        .doNotMergeToTheRight(storedErrorInterval.getDoNotMergeToTheRight())
                        .build());
            }
        }
        syntheticResults.add(ImmutableSyntheticResult.builder()
                .captureTime(captureTime)
                .totalDurationNanos(totalDurationNanos)
                .executionCount(executionCount)
                .addAllErrorIntervals(errorIntervals)
                .build());
    }
    return syntheticResults;
}
 
Example 18
Source File: AbstractCassandraProcessor.java    From nifi with Apache License 2.0 4 votes vote down vote up
protected static Object getCassandraObject(Row row, int i, DataType dataType) {
    if (dataType.equals(DataType.blob())) {
        return row.getBytes(i);

    } else if (dataType.equals(DataType.varint()) || dataType.equals(DataType.decimal())) {
        // Avro can't handle BigDecimal and BigInteger as numbers - it will throw an
        // AvroRuntimeException such as: "Unknown datum type: java.math.BigDecimal: 38"
        return row.getObject(i).toString();

    } else if (dataType.equals(DataType.cboolean())) {
        return row.getBool(i);

    } else if (dataType.equals(DataType.cint())) {
        return row.getInt(i);

    } else if (dataType.equals(DataType.bigint())
            || dataType.equals(DataType.counter())) {
        return row.getLong(i);

    } else if (dataType.equals(DataType.ascii())
            || dataType.equals(DataType.text())
            || dataType.equals(DataType.varchar())) {
        return row.getString(i);

    } else if (dataType.equals(DataType.cfloat())) {
        return row.getFloat(i);

    } else if (dataType.equals(DataType.cdouble())) {
        return row.getDouble(i);

    } else if (dataType.equals(DataType.timestamp())) {
        return row.getTimestamp(i);

    } else if (dataType.equals(DataType.date())) {
        return row.getDate(i);

    } else if (dataType.equals(DataType.time())) {
        return row.getTime(i);

    } else if (dataType.isCollection()) {

        List<DataType> typeArguments = dataType.getTypeArguments();
        if (typeArguments == null || typeArguments.size() == 0) {
            throw new IllegalArgumentException("Column[" + i + "] " + dataType.getName()
                    + " is a collection but no type arguments were specified!");
        }
        // Get the first type argument, to be used for lists and sets (and the first in a map)
        DataType firstArg = typeArguments.get(0);
        TypeCodec firstCodec = codecRegistry.codecFor(firstArg);
        if (dataType.equals(DataType.set(firstArg))) {
            return row.getSet(i, firstCodec.getJavaType());
        } else if (dataType.equals(DataType.list(firstArg))) {
            return row.getList(i, firstCodec.getJavaType());
        } else {
            // Must be an n-arg collection like map
            DataType secondArg = typeArguments.get(1);
            TypeCodec secondCodec = codecRegistry.codecFor(secondArg);
            if (dataType.equals(DataType.map(firstArg, secondArg))) {
                return row.getMap(i, firstCodec.getJavaType(), secondCodec.getJavaType());
            }
        }

    } else {
        // The different types that we support are numbers (int, long, double, float),
        // as well as boolean values and Strings. Since Avro doesn't provide
        // timestamp types, we want to convert those to Strings. So we will cast anything other
        // than numbers or booleans to strings by using the toString() method.
        return row.getObject(i).toString();
    }
    return null;
}
 
Example 19
Source File: Functions.java    From hawkular-metrics with Apache License 2.0 4 votes vote down vote up
public static DataPoint<Double> getGaugeDataPoint(Row row) {
    return new DataPoint<>(
            UUIDs.unixTimestamp(row.getUUID(GAUGE_COLS.TIME.ordinal())),
            row.getDouble(GAUGE_COLS.VALUE.ordinal()),
            row.getMap(GAUGE_COLS.TAGS.ordinal(), String.class, String.class));
}
 
Example 20
Source File: Functions.java    From hawkular-metrics with Apache License 2.0 4 votes vote down vote up
public static DataPoint<Double> getTempGaugeDataPoint(Row row) {
    return new DataPoint<>(
            row.getTimestamp(GAUGE_COLS.TIME.ordinal()).toInstant().toEpochMilli(),
            row.getDouble(GAUGE_COLS.VALUE.ordinal()),
            row.getMap(GAUGE_COLS.TAGS.ordinal(), String.class, String.class));
}