Search in sources :

Example 1 with Attribute

use of org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute in project hadoop by apache.

the class HBaseTimelineWriterImpl method storeAppFinishedInFlowRunTable.

/*
   * Update the {@link FlowRunTable} with Application Finished information
   */
private void storeAppFinishedInFlowRunTable(FlowRunRowKey flowRunRowKey, String appId, TimelineEntity te, long appFinishedTimeStamp) throws IOException {
    byte[] rowKey = flowRunRowKey.getRowKey();
    Attribute attributeAppId = AggregationCompactionDimension.APPLICATION_ID.getAttribute(appId);
    FlowRunColumn.MAX_END_TIME.store(rowKey, flowRunTable, null, appFinishedTimeStamp, attributeAppId);
    // store the final value of metrics since application has finished
    Set<TimelineMetric> metrics = te.getMetrics();
    if (metrics != null) {
        storeFlowMetrics(rowKey, metrics, attributeAppId, AggregationOperation.SUM_FINAL.getAttribute());
    }
}
Also used : TimelineMetric(org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric) Attribute(org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute)

Example 2 with Attribute

use of org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute in project hadoop by apache.

the class ColumnHelper method store.

/**
   * Sends a Mutation to the table. The mutations will be buffered and sent over
   * the wire as part of a batch.
   *
   * @param rowKey
   *          identifying the row to write. Nothing gets written when null.
   * @param tableMutator
   *          used to modify the underlying HBase table
   * @param columnQualifier
   *          column qualifier. Nothing gets written when null.
   * @param timestamp
   *          version timestamp. When null the current timestamp multiplied with
   *          TimestampGenerator.TS_MULTIPLIER and added with last 3 digits of
   *          app id will be used
   * @param inputValue
   *          the value to write to the rowKey and column qualifier. Nothing
   *          gets written when null.
   * @param attributes Attributes to be set for HBase Put.
   * @throws IOException if any problem occurs during store operation(sending
   *          mutation to table).
   */
public void store(byte[] rowKey, TypedBufferedMutator<?> tableMutator, byte[] columnQualifier, Long timestamp, Object inputValue, Attribute... attributes) throws IOException {
    if ((rowKey == null) || (columnQualifier == null) || (inputValue == null)) {
        return;
    }
    Put p = new Put(rowKey);
    timestamp = getPutTimestamp(timestamp, attributes);
    p.addColumn(columnFamilyBytes, columnQualifier, timestamp, converter.encodeValue(inputValue));
    if ((attributes != null) && (attributes.length > 0)) {
        for (Attribute attribute : attributes) {
            p.setAttribute(attribute.getName(), attribute.getValue());
        }
    }
    tableMutator.mutate(p);
}
Also used : Attribute(org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute) Put(org.apache.hadoop.hbase.client.Put)

Example 3 with Attribute

use of org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute in project hadoop by apache.

the class HBaseTimelineStorageUtils method combineAttributes.

/**
   * Combines the input array of attributes and the input aggregation operation
   * into a new array of attributes.
   *
   * @param attributes Attributes to be combined.
   * @param aggOp Aggregation operation.
   * @return array of combined attributes.
   */
public static Attribute[] combineAttributes(Attribute[] attributes, AggregationOperation aggOp) {
    int newLength = getNewLengthCombinedAttributes(attributes, aggOp);
    Attribute[] combinedAttributes = new Attribute[newLength];
    if (attributes != null) {
        System.arraycopy(attributes, 0, combinedAttributes, 0, attributes.length);
    }
    if (aggOp != null) {
        Attribute a2 = aggOp.getAttribute();
        combinedAttributes[newLength - 1] = a2;
    }
    return combinedAttributes;
}
Also used : Attribute(org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute)

Aggregations

Attribute (org.apache.hadoop.yarn.server.timelineservice.storage.flow.Attribute)3 Put (org.apache.hadoop.hbase.client.Put)1 TimelineMetric (org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric)1