@Override
  public  String getIndexName(Event event) {
    String realIndexPrefix = BucketPath.escapeString(event.getIndexPrefix() != null ? event.getIndexPrefix() : indexPrefix, event.getHeaders());
    if(event.getIndexTimestamp() != null){

      String indexName = new StringBuilder(realIndexPrefix).append('-')
              .append(event.getIndexTimestamp()).toString();
      if(logger.isDebugEnabled())
        logger.debug("Index Name = " + indexName);
      return indexName;
    }
    else {
      TimestampedEvent timestampedEvent = new TimestampedEvent(event);
      long timestamp = timestampedEvent.getTimestamp();
      String indexName = new StringBuilder(realIndexPrefix).append('-')
              .append(fastDateFormat.format(timestamp)).toString();
      if(logger.isDebugEnabled())
        logger.debug("Index Name = " + indexName);
      return indexName;
    }
  }
@ Override public String getIndexName ( Event event ) { String realIndexPrefix = BucketPath . escapeString ( event . getIndexPrefix ( ) != null ? event . getIndexPrefix ( ) : indexPrefix , event . getHeaders ( ) ) ; if ( event . getIndexTimestamp ( ) != null ) { String indexName = new StringBuilder ( realIndexPrefix ) . append ( '-' ) . append ( event . getIndexTimestamp ( ) ) . toString ( ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Index Name = " + indexName ) ; return indexName ; } else { TimestampedEvent timestampedEvent = new TimestampedEvent ( event ) ; long timestamp = timestampedEvent . getTimestamp ( ) ; String indexName = new StringBuilder ( realIndexPrefix ) . append ( '-' ) . append ( fastDateFormat . format ( timestamp ) ) . toString ( ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Index Name = " + indexName ) ; return indexName ; } }
Gets the name of the index to use for an index request
@param event
Event for which the name of index has to be prepared
@return index name of the form 'indexPrefix-formattedTimestamp'