From ca5e15958efd4e011fe5fb8494d72606ca792e33 Mon Sep 17 00:00:00 2001 From: Santhosh Vasabhaktula Date: Sat, 12 Mar 2016 23:47:25 +0530 Subject: [PATCH] add new config param for s3 file partition - "currentDate" --- src/main/java/com/pinterest/secor/common/LogFilePath.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/pinterest/secor/common/LogFilePath.java b/src/main/java/com/pinterest/secor/common/LogFilePath.java index ec642de41..2c7c5760e 100644 --- a/src/main/java/com/pinterest/secor/common/LogFilePath.java +++ b/src/main/java/com/pinterest/secor/common/LogFilePath.java @@ -60,6 +60,7 @@ public class LogFilePath { private final String mExtension; private String mOutputFilePattern; private SimpleDateFormat timeFormat = new SimpleDateFormat("HH-mm"); + private SimpleDateFormat dateFormat = new SimpleDateFormat("YYYYMMDD"); public LogFilePath(String prefix, int generation, long lastCommittedOffset, ParsedMessage message, String extension) { @@ -198,6 +199,7 @@ private Map getValueMap() { valueMap.put("fmOffset", String.format("%020d", mOffset)); valueMap.put("currentTimestamp", System.currentTimeMillis() + ""); valueMap.put("currentTime", timeFormat.format(new Date())); + valueMap.put("currentDate", dateFormat.format(new Date())); return valueMap; }