Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.facebook.presto.event.query;
 
 
 
 @EventType("SplitCompletion")
 public class SplitCompletionEvent
 {
     private final QueryId queryId;
     private final StageId stageId;
     private final TaskId taskId;
 
     private final String environment;
 
     private final Duration queuedTimeMs;
     private final DateTime executionStartTime;
 
     private final Long timeToFirstByteMs;
     private final Long timeToLastByteMs;
 
     private final DataSize completedDataSize;
     private final long completedPositions;
     private final Long completedReadTimeMs;
 
     private final Long wallTimeMs;
     private final Long cpuTimeMs;
     private final Long userTimeMs;
 
     private final String failureType;
     private final String failureMessage;
 
     private final String splitInfoJson;
 
     public SplitCompletionEvent(
             QueryId queryId,
             StageId stageId,
             TaskId taskId,
             String environment,
             Duration queuedTimeMs,
             @Nullable DateTime executionStartTime,
             @Nullable Duration timeToFirstByte,
             @Nullable Duration timeToLastByte,
             DataSize completedDataSize,
             long completedPositions,
             Duration completedReadTime,
             @Nullable Duration wallTime,
             @Nullable Duration cpuTime,
             @Nullable Duration userTime,
             @Nullable String failureType,
             @Nullable String failureMessage,
             String splitInfoJson)
     {
         Preconditions.checkNotNull(queryId"queryId is null");
         Preconditions.checkNotNull(stageId"stageId is null");
         Preconditions.checkNotNull(taskId"taskId is null");
         Preconditions.checkNotNull(completedDataSize"completedDataSize is null");
         Preconditions.checkNotNull(completedPositions"completedPositions is null");
         Preconditions.checkNotNull(splitInfoJson"splitInfoJson is null");
 
         this. = queryId;
         this. = stageId;
         this. = taskId;
         this. = environment;
         this. = queuedTimeMs;
         this. = executionStartTime;
         this. = durationToMillis(timeToFirstByte);
         this. = durationToMillis(timeToLastByte);
         this. = completedDataSize;
         this. = completedPositions;
         this. = durationToMillis(completedReadTime);
         this. = durationToMillis(wallTime);
         this. = durationToMillis(cpuTime);
         this. = durationToMillis(userTime);
         this. = failureType;
         this. = failureMessage;
        this. = splitInfoJson;
    }
    @Nullable
    private static Long durationToMillis(@Nullable Duration duration)
    {
        if (duration == null) {
            return null;
        }
        return duration.toMillis();
    }
    @EventField
    public String getQueryId()
    {
        return .toString();
    }
    @EventField
    public String getStageId()
    {
        return .toString();
    }
    @EventField
    public String getTaskId()
    {
        return .toString();
    }
    @EventField
    public String getEnvironment()
    {
        return ;
    }
    @EventField
    public long getQueuedTimeMs()
    {
        return .toMillis();
    }
    @EventField
    {
        return ;
    }
    @EventField
    public Long getTimeToFirstByteMs()
    {
        return ;
    }
    @EventField
    public Long getTimeToLastByteMs()
    {
        return ;
    }
    @EventField
    public long getCompletedDataSizeTotal()
    {
        return .toBytes();
    }
    @EventField
    public long getCompletedPositionsTotal()
    {
        return ;
    }
    @EventField
    public Long getCompletedReadTimeMs()
    {
        return ;
    }
    @EventField
    public Long getWallTimeMs()
    {
        return ;
    }
    @EventField
    public Long getCpuTimeMs()
    {
        return ;
    }
    @EventField
    public Long getUserTimeMs()
    {
        return ;
    }
    @EventField
    public String getFailureType()
    {
        return ;
    }
    @EventField
    public String getFailureMessage()
    {
        return ;
    }
    @EventField
    public String getSplitInfoJson()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X