Projects >> accumulo >>089408d596941e3c621037d35288bdd87deca5b7

Chunk
Conflicting content
    long now = System.currentTimeMillis();
  private static final long MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS = 1000;
  private static final long RECENTLY_SPLIT_MILLIES = 60 * 1000;
  private static final long TIME_BETWEEN_GC_CHECKS = 5000;
<<<<<<< HEAD
  private static final Set EMPTY_COLUMNS = Collections.emptySet();
=======

  private TabletServerLogger logger;

  protected TabletServerMinCMetrics mincMetrics = new TabletServerMinCMetrics();

  private ServerConfiguration serverConfig;
  private LogSorter logSorter = null;

  public TabletServer(ServerConfiguration conf, VolumeManager fs) {
    super();
    this.serverConfig = conf;
    this.instance = conf.getInstance();
    this.fs = fs;
    this.logSorter = new LogSorter(instance, fs, getSystemConfiguration());
    SimpleTimer.getInstance().schedule(new Runnable() {
      @Override
      public void run() {
        synchronized (onlineTablets) {
          long now = System.currentTimeMillis();
          for (Tablet tablet : onlineTablets.values())
            try {
              tablet.updateRates(now);
            } catch (Exception ex) {
              log.error(ex, ex);
            }
        }
      }
    }, TIME_BETWEEN_GC_CHECKS, TIME_BETWEEN_GC_CHECKS);
  }

  private synchronized static void logGCInfo(AccumuloConfiguration conf) {
    List gcmBeans = ManagementFactory.getGarbageCollectorMXBeans();
    Runtime rt = Runtime.getRuntime();

    StringBuilder sb = new StringBuilder("gc");

    boolean sawChange = false;

    long maxIncreaseInCollectionTime = 0;

    for (GarbageCollectorMXBean gcBean : gcmBeans) {
      Long prevTime = prevGcTime.get(gcBean.getName());
      long pt = 0;
      if (prevTime != null) {
        pt = prevTime;
      }

      long time = gcBean.getCollectionTime();

      if (time - pt != 0) {
        sawChange = true;
      }

      long increaseInCollectionTime = time - pt;
      sb.append(String.format(" %s=%,.2f(+%,.2f) secs", gcBean.getName(), time / 1000.0, increaseInCollectionTime / 1000.0));
      maxIncreaseInCollectionTime = Math.max(increaseInCollectionTime, maxIncreaseInCollectionTime);
      prevGcTime.put(gcBean.getName(), time);
    }

    long mem = rt.freeMemory();
    if (maxIncreaseInCollectionTime == 0) {
      gcTimeIncreasedCount = 0;
    } else {
      gcTimeIncreasedCount++;
      if (gcTimeIncreasedCount > 3 && mem < rt.maxMemory() * 0.05) {
        log.warn("Running low on memory");
        gcTimeIncreasedCount = 0;
      }
    }

    if (mem > lastMemorySize) {
      sawChange = true;
    }

    String sign = "+";
    if (mem - lastMemorySize <= 0) {
      sign = "";
    }

    sb.append(String.format(" freemem=%,d(%s%,d) totalmem=%,d", mem, sign, (mem - lastMemorySize), rt.totalMemory()));

    if (sawChange) {
      log.debug(sb.toString());
    }

    final long keepAliveTimeout = conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT);
    if (lastMemoryCheckTime > 0 && lastMemoryCheckTime < now) {
      long diff = now - lastMemoryCheckTime;
      if (diff > keepAliveTimeout) {
        log.warn(String.format("GC pause checker not called in a timely fashion. Expected every %.1f seconds but was %.1f seconds since last check",
                    TIME_BETWEEN_GC_CHECKS / 1000., diff / 1000.));
      }
      lastMemoryCheckTime = now;
      return;
    }

    if (maxIncreaseInCollectionTime > keepAliveTimeout) {
      Halt.halt("Garbage collection may be interfering with lock keep-alive.  Halting.", -1);
    }
>>>>>>> d65e0e32de29206b627e578b957ce66c0d644cea

  private final GarbageCollectionLogger gcLogger = new GarbageCollectionLogger();
  private final TransactionWatcher watcher = new TransactionWatcher();
Solution content
  private static final long MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS = 1000;
  private static final long RECENTLY_SPLIT_MILLIES = 60 * 1000;
  private static final long TIME_BETWEEN_GC_CHECKS = 5000;
  private static final Set EMPTY_COLUMNS = Collections.emptySet();

  private final GarbageCollectionLogger gcLogger = new GarbageCollectionLogger();
  private final TransactionWatcher watcher = new TransactionWatcher();
File
TabletServer.java
Developer's decision
Version 1
Kind of conflict
Attribute
For statement
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
  }

  /**
<<<<<<< HEAD
   * Reference a pre-existing log file.
   * @param meta the cq for the "log" entry in +r/!0
=======
   * Refernce a pre-existing log file.
   *
   * @param meta
   *          the cq for the "log" entry in +r/!0
>>>>>>> d65e0e32de29206b627e578b957ce66c0d644cea
   */
  public DfsLogger(ServerResources conf, String filename, String meta) throws IOException {
    this.conf = conf;
Solution content
  }

  /**
   * Reference a pre-existing log file.
   * @param meta the cq for the "log" entry in +r/!0
   */
  public DfsLogger(ServerResources conf, String filename, String meta) throws IOException {
    this.conf = conf;
File
DfsLogger.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
      if (fs.isFile(path)) {
        // read log entries from a simple hdfs file
<<<<<<< HEAD
        DFSLoggerInputStreams streams = DfsLogger.readHeaderAndReturnStream(fs, path, SiteConfiguration.getInstance());
=======
        DFSLoggerInputStreams streams;
        try {
          streams = DfsLogger.readHeaderAndReturnStream(fs, path, ServerConfiguration.getSiteConfiguration());
        } catch (LogHeaderIncompleteException e) {
          log.warn("Could not read header for " + path + ". Ignoring...");
          continue;
        }
>>>>>>> d65e0e32de29206b627e578b957ce66c0d644cea
        DataInputStream input = streams.getDecryptingInputStream();

        try {
Solution content
      if (fs.isFile(path)) {
        // read log entries from a simple hdfs file
        DFSLoggerInputStreams streams;
        try {
          streams = DfsLogger.readHeaderAndReturnStream(fs, path, SiteConfiguration.getInstance());
        } catch (LogHeaderIncompleteException e) {
          log.warn("Could not read header for " + path + ". Ignoring...");
          continue;
        }
        DataInputStream input = streams.getDecryptingInputStream();

        try {
File
LogReader.java
Developer's decision
Manual
Kind of conflict
Method invocation
Try statement
Variable