Class HttpdLogRecord

java.lang.Object
org.apache.drill.exec.store.httpd.HttpdLogRecord

public class HttpdLogRecord extends Object
  • Constructor Details

    • HttpdLogRecord

      public HttpdLogRecord(String timeFormat, boolean flattenWildcards)
  • Method Details

    • finishRecord

      public void finishRecord()
      Call this method after a record has been parsed. This finished the lifecycle of any maps that were written and removes all the entries for the next record to be able to work.
    • set

      public void set(String field, String value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a String data type.
      Parameters:
      field - name of field
      value - value of field
    • set

      public void set(String field, Long value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a Long data type.
      Parameters:
      field - name of field
      value - value of field
    • setDate

      public void setDate(String field, String value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a Date data type.
      Parameters:
      field - name of field
      value - value of field
    • setTime

      public void setTime(String field, String value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a Time data type.
      Parameters:
      field - name of field
      value - value of field
    • setTimestampFromEpoch

      public void setTimestampFromEpoch(String field, Long value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a timestamp data type.
      Parameters:
      field - name of field
      value - value of field
    • setTimestamp

      public void setTimestamp(String field, String value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a timestamp data type.
      Parameters:
      field - name of field
      value - value of field
    • set

      public void set(String field, Double value)
      This method is referenced and called via reflection. This is added as a parsing target for the parser. It will get called when the value of a log field is a Double data type.
      Parameters:
      field - name of field
      value - value of field
    • setWildcard

      public void setWildcard(String field, String value)
      This method is referenced and called via reflection. When the parser processes a field like: HTTP.URI:request.firstline.uri.query.* where star is an arbitrary field that the parser found this method will be invoked.
      Parameters:
      field - name of field
      value - value of field
    • setWildcard

      public void setWildcard(String field, Long value)
      This method is referenced and called via reflection. When the parser processes a field like: HTTP.URI:request.firstline.uri.query.* where star is an arbitrary field that the parser found this method will be invoked.
      Parameters:
      field - name of field
      value - value of field
    • setWildcard

      public void setWildcard(String field, Double value)
      This method is referenced and called via reflection. When the parser processes a field like: HTTP.URI:request.firstline.uri.query.* where star is an arbitrary field that the parser found this method will be invoked.
      Parameters:
      field - name of field
      value - value of field
    • getStrings

      public Map<String,ScalarWriter> getStrings()
    • getLongs

      public Map<String,ScalarWriter> getLongs()
    • getDoubles

      public Map<String,ScalarWriter> getDoubles()
    • getTimestamps

      public Map<String,ScalarWriter> getTimestamps()
    • addField

      public void addField(nl.basjes.parse.core.Parser<HttpdLogRecord> parser, RowSetLoader rowWriter, Map<String,nl.basjes.parse.core.Casts> columnCasts, String parserFieldName, String drillFieldName, Map<String,TypeProtos.MinorType> mappedColumns) throws NoSuchMethodException
      This record will be used with a single parser. For each field that is to be parsed a setter will be called. It registers a setter method for each field being parsed. It also builds the data writers to hold the data beings parsed.
      Parameters:
      parser - The initialized HttpdParser
      rowWriter - An initialized RowSetLoader object
      columnCasts - The logparser casts used to get the right data from the parser
      parserFieldName - The field name which is generated by the Httpd Parser. These are not "Drill safe"
      drillFieldName - The Drill safe field name
      mappedColumns - A list of columns mapped to their correct Drill data type
      Throws:
      NoSuchMethodException - Thrown in the event that the parser does not have a correct setter method