ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [5/5] git commit: ARGUS-5: fix per review comments
Date Tue, 23 Sep 2014 18:33:32 GMT
ARGUS-5: fix per review comments

Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/647cdb7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/647cdb7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/647cdb7e

Branch: refs/heads/master
Commit: 647cdb7eea386b34db1c300996a13b848eefc361
Parents: b6efd47
Author: mneethiraj <mneethiraj@hortonworks.com>
Authored: Tue Sep 23 11:32:49 2014 -0700
Committer: mneethiraj <mneethiraj@hortonworks.com>
Committed: Tue Sep 23 11:32:49 2014 -0700

----------------------------------------------------------------------
 .../xasecure/audit/provider/LocalFileLogBuffer.java   | 14 +++++++-------
 .../audit/provider/hdfs/HdfsLogDestination.java       | 10 +++++-----
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/647cdb7e/agents-audit/src/main/java/com/xasecure/audit/provider/LocalFileLogBuffer.java
----------------------------------------------------------------------
diff --git a/agents-audit/src/main/java/com/xasecure/audit/provider/LocalFileLogBuffer.java
b/agents-audit/src/main/java/com/xasecure/audit/provider/LocalFileLogBuffer.java
index 8738bf0..767cbc4 100644
--- a/agents-audit/src/main/java/com/xasecure/audit/provider/LocalFileLogBuffer.java
+++ b/agents-audit/src/main/java/com/xasecure/audit/provider/LocalFileLogBuffer.java
@@ -202,9 +202,9 @@ public class LocalFileLogBuffer<T> implements LogBuffer<T>
{
 
 		closeFile();
 
-		mNextRolloverTime = MiscUtil.getNextRolloverTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000));
+		mNextRolloverTime = MiscUtil.getNextRolloverTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000L));
 
-		long startTime = MiscUtil.getRolloverStartTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000));
+		long startTime = MiscUtil.getRolloverStartTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000L));
 
 		mBufferFilename = MiscUtil.replaceTokens(mDirectory + File.separator + mFile, startTime);
 
@@ -226,7 +226,7 @@ public class LocalFileLogBuffer<T> implements LogBuffer<T>
{
 		if(mWriter != null) {
 			LogLog.debug("LocalFileLogBuffer.openFile(): opened file " + mBufferFilename);
 
-			mNextFlushTime = System.currentTimeMillis() + (mFlushIntervalSeconds * 1000);
+			mNextFlushTime = System.currentTimeMillis() + (mFlushIntervalSeconds * 1000L);
 		} else {
 			LogLog.warn("LocalFileLogBuffer.openFile(): failed to open file for write " + mBufferFilename);
 
@@ -280,7 +280,7 @@ public class LocalFileLogBuffer<T> implements LogBuffer<T>
{
 			try {
 				mWriter.flush();
 
-				mNextFlushTime = now + (mFlushIntervalSeconds * 1000);
+				mNextFlushTime = now + (mFlushIntervalSeconds * 1000L);
 			} catch (IOException excp) {
 				LogLog.warn("LocalFileLogBuffer: failed to flush", excp);
 			}
@@ -400,7 +400,7 @@ class DestinationDispatcherThread<T> extends Thread {
 
 		mDestination.start();
 
-		int pollIntervalInMs = 1000;
+		long pollIntervalInMs = 1000L;
 
 		while(! mStopThread) {
 			synchronized(mCompletedLogfiles) {
@@ -452,7 +452,7 @@ class DestinationDispatcherThread<T> extends Thread {
 
 		boolean ret = false;
 
-		int destinationPollIntervalInMs = 1000;
+		long destinationPollIntervalInMs = 1000L;
 
 		openCurrentFile();
 
@@ -628,7 +628,7 @@ class DestinationDispatcherThread<T> extends Thread {
 	    return reader;
 	}
 
-	private void sleep(int sleepTimeInMs, String onFailMsg) {
+	private void sleep(long sleepTimeInMs, String onFailMsg) {
 		try {
 			Thread.sleep(sleepTimeInMs);
 		} catch(InterruptedException excp) {

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/647cdb7e/agents-audit/src/main/java/com/xasecure/audit/provider/hdfs/HdfsLogDestination.java
----------------------------------------------------------------------
diff --git a/agents-audit/src/main/java/com/xasecure/audit/provider/hdfs/HdfsLogDestination.java
b/agents-audit/src/main/java/com/xasecure/audit/provider/hdfs/HdfsLogDestination.java
index 42119f8..c524e0b 100644
--- a/agents-audit/src/main/java/com/xasecure/audit/provider/hdfs/HdfsLogDestination.java
+++ b/agents-audit/src/main/java/com/xasecure/audit/provider/hdfs/HdfsLogDestination.java
@@ -171,9 +171,9 @@ public class HdfsLogDestination<T> implements LogDestination<T>
{
 
 		closeFile();
 
-		mNextRolloverTime = MiscUtil.getNextRolloverTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000));
+		mNextRolloverTime = MiscUtil.getNextRolloverTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000L));
 
-		long startTime = MiscUtil.getRolloverStartTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000));
+		long startTime = MiscUtil.getRolloverStartTime(mNextRolloverTime, (mRolloverIntervalSeconds
* 1000L));
 
 		mHdfsFilename = MiscUtil.replaceTokens(mDirectory + File.separator + mFile, startTime);
 
@@ -235,7 +235,7 @@ public class HdfsLogDestination<T> implements LogDestination<T>
{
 		if(mWriter != null) {
 			LogLog.debug("HdfsLogDestination.openFile(): opened file " + mHdfsFilename);
 
-			mNextFlushTime      = System.currentTimeMillis() + (mFlushIntervalSeconds * 1000);
+			mNextFlushTime      = System.currentTimeMillis() + (mFlushIntervalSeconds * 1000L);
 			mLastOpenFailedTime = 0;
 		} else {
 			LogLog.warn("HdfsLogDestination.openFile(): failed to open file for write " + mHdfsFilename);
@@ -282,7 +282,7 @@ public class HdfsLogDestination<T> implements LogDestination<T>
{
 		long now = System.currentTimeMillis();
 
 		if(mWriter == null) {
-			if(now > (mLastOpenFailedTime + (mOpenRetryIntervalSeconds * 1000))) {
+			if(now > (mLastOpenFailedTime + (mOpenRetryIntervalSeconds * 1000L))) {
 				openFile();
 			}
 		} else  if(now > mNextRolloverTime) {
@@ -291,7 +291,7 @@ public class HdfsLogDestination<T> implements LogDestination<T>
{
 			try {
 				mWriter.flush();
 
-				mNextFlushTime = now + (mFlushIntervalSeconds * 1000);
+				mNextFlushTime = now + (mFlushIntervalSeconds * 1000L);
 			} catch (IOException excp) {
 				LogLog.warn("HdfsLogDestination: failed to flush", excp);
 			}


Mime
View raw message