Example usage for com.google.common.collect Table toString

List of usage examples for com.google.common.collect Table toString

Introduction

In this page you can find the example usage for com.google.common.collect Table toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.netease.flume.taildirSource.ReliableTaildirEventReader.java

/**
 * Create a ReliableTaildirEventReader to watch the given directory.
 *///from w  ww.j a  va2s.  c  om
private ReliableTaildirEventReader(Map<String, String> filePaths, Map<String, String> targetFilenames,
        Table<String, String, String> headerTable, String positionFilePath, boolean skipToEnd,
        boolean addByteOffset) throws IOException {
    // Sanity checks
    Preconditions.checkNotNull(filePaths);
    Preconditions.checkNotNull(positionFilePath);

    if (logger.isDebugEnabled()) {
        logger.debug("Initializing {} with directory={}, metaDir={}",
                new Object[] { ReliableTaildirEventReader.class.getSimpleName(), filePaths });
    }

    Table<String, File, Pattern> tailFileTable = HashBasedTable.create();
    for (Entry<String, String> e : filePaths.entrySet()) {
        File f = new File(e.getValue());
        File parentDir = f.getParentFile();
        Preconditions.checkState(parentDir.exists(),
                "Directory does not exist: " + parentDir.getAbsolutePath());
        Pattern fileNamePattern = Pattern.compile(f.getName());
        tailFileTable.put(e.getKey(), parentDir, fileNamePattern);
    }
    logger.info("tailFileTable: " + tailFileTable.toString());
    logger.info("headerTable: " + headerTable.toString());

    this.targetFilenames = targetFilenames;
    this.tailFileTable = tailFileTable;
    this.headerTable = headerTable;
    this.addByteOffset = addByteOffset;
    updateTailFiles(skipToEnd);

    logger.info("Updating position from position file: " + positionFilePath);
    loadPositionFile(positionFilePath);
}

From source file:com.urey.flume.source.taildir.ReliableTaildirEventReader.java

/**
 * Create a ReliableTaildirEventReader to watch the given directory.
 */// w w w . j a  va2  s  .c  om
private ReliableTaildirEventReader(Map<String, String> filePaths, Table<String, String, String> headerTable,
        String positionFilePath, boolean skipToEnd, boolean addByteOffset, boolean recursiveDirectorySearch,
        boolean annotateYarnApplicationId, boolean annotateYarnContainerId, boolean annotateFileName,
        String fileNameHeader) throws IOException {
    // Sanity checks
    Preconditions.checkNotNull(filePaths);
    Preconditions.checkNotNull(positionFilePath);

    if (logger.isDebugEnabled()) {
        logger.debug("Initializing {} with directory={}, metaDir={}",
                new Object[] { ReliableTaildirEventReader.class.getSimpleName(), filePaths });
    }

    Table<String, File, Pattern> tailFileTable = HashBasedTable.create();
    for (Entry<String, String> e : filePaths.entrySet()) {
        File f = new File(e.getValue());
        File parentDir = f.getParentFile();
        Preconditions.checkState(parentDir.exists(),
                "Directory does not exist: " + parentDir.getAbsolutePath());
        Pattern fileNamePattern = Pattern.compile(f.getName());
        tailFileTable.put(e.getKey(), parentDir, fileNamePattern);
    }
    logger.info("tailFileTable: " + tailFileTable.toString());
    logger.info("headerTable: " + headerTable.toString());

    this.tailFileTable = tailFileTable;
    this.headerTable = headerTable;
    this.addByteOffset = addByteOffset;

    this.recursiveDirectorySearch = recursiveDirectorySearch;
    this.annotateYarnApplicationId = annotateYarnApplicationId;
    this.annotateYarnContainerId = annotateYarnContainerId;

    this.annotateFileName = annotateFileName;
    this.fileNameHeader = fileNameHeader;

    updateTailFiles(skipToEnd);

    logger.info("Updating position from position file: " + positionFilePath);
    loadPositionFile(positionFilePath);
}

From source file:org.apache.flume.source.taildir.ReliableTaildirEventReader.java

/**
 * Create a ReliableTaildirEventReader to watch the given directory.
 *///from ww w  .  j  a va2  s.  c om
private ReliableTaildirEventReader(Map<String, String> filePaths, Table<String, String, String> headerTable,
        String positionFilePath, boolean skipToEnd, boolean addByteOffset, boolean cachePatternMatching,
        boolean annotateFileName, String fileNameHeader, boolean multiLine, String multiLineRegex)
        throws IOException {
    // Sanity checks
    Preconditions.checkNotNull(filePaths);
    Preconditions.checkNotNull(positionFilePath);

    if (logger.isDebugEnabled()) {
        logger.debug("Initializing {} with directory={}, metaDir={}",
                new Object[] { ReliableTaildirEventReader.class.getSimpleName(), filePaths });
    }

    List<TaildirMatcher> taildirCache = Lists.newArrayList();
    for (Entry<String, String> e : filePaths.entrySet()) {
        taildirCache.add(new TaildirMatcher(e.getKey(), e.getValue(), cachePatternMatching));
    }
    logger.info("taildirCache: " + taildirCache.toString());
    logger.info("headerTable: " + headerTable.toString());

    this.taildirCache = taildirCache;
    this.headerTable = headerTable;
    this.addByteOffset = addByteOffset;
    this.cachePatternMatching = cachePatternMatching;
    this.annotateFileName = annotateFileName;
    this.fileNameHeader = fileNameHeader;
    this.multiLine = multiLine;
    this.multiLineRegex = multiLineRegex;
    updateTailFiles(skipToEnd);

    logger.info("Updating position from position file: " + positionFilePath);
    loadPositionFile(positionFilePath);
}