protected void rotateOutputFile(boolean doRotateAction) throws IOException { LOG.info("Rotating output file..."); long start = System.currentTimeMillis(); closeOutputFile(); this.rotation++; Path newFile = createOutputFile(); if (doRotateAction) { LOG.info("Performing {} file rotation actions.", this.rotationActions.size()); for (RotationAction action : this.rotationActions) { action.execute(this.fs, this.currentFile); } } this.currentFile = newFile; long time = System.currentTimeMillis() - start; LOG.info("File rotation took {} ms.", time); }
protected void rotateOutputFile(boolean doRotateAction) throws IOException { LOG.info("Rotating output file..."); long start = System.currentTimeMillis(); closeOutputFile(); this.rotation++; Path newFile = createOutputFile(); if (doRotateAction) { LOG.info("Performing {} file rotation actions.", this.rotationActions.size()); for (RotationAction action : this.rotationActions) { action.execute(this.fs, this.currentFile); } } this.currentFile = newFile; long time = System.currentTimeMillis() - start; LOG.info("File rotation took {} ms.", time); }
protected void rotateOutputFile() throws IOException { LOG.info("Rotating output file..."); long start = System.currentTimeMillis(); synchronized (this.writeLock) { closeOutputFile(); this.rotation++; Path newFile = createOutputFile(); LOG.info("Performing {} file rotation actions.", this.rotationActions.size()); for (RotationAction action : this.rotationActions) { action.execute(this.fs, this.currentFile); } this.currentFile = newFile; } long time = System.currentTimeMillis() - start; LOG.info("File rotation took {} ms.", time); }
/** * for unit tests */ void close() throws IOException { this.options.closeOutputFile(); } }
/** * for unit tests */ void close() throws IOException { this.options.closeOutputFile(); }