From 6433cd51b05ba7a2edfbccb38db0e7c996819560 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 16 Apr 2018 14:28:44 -0500 Subject: Create Cassandra Backup Scripts Issue-ID: AAF-249 Change-Id: I014a925545b9be1171e625dfd751e77350843405 Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/local/TextIndex.java | 95 ++++++++++++---------- 1 file changed, 50 insertions(+), 45 deletions(-) (limited to 'auth/auth-core') diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java index 4cf2dd5d..6ef6a769 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java @@ -125,65 +125,70 @@ public class TextIndex { } public void create(final Trans trans,final DataFile data, int maxLine, char delim, int fieldOffset, int skipLines) throws IOException { - RandomAccessFile raf; FileChannel fos; List list = new LinkedList(); // Some hashcodes will double... DO NOT make a set TimeTaken tt2 = trans.start("Open Files", Env.SUB); + RandomAccessFile raf=null; try { - raf = new RandomAccessFile(file,"rw"); - raf.setLength(0L); - fos = raf.getChannel(); - } finally { - tt2.done(); - } - - try { - - Token t = data.new Token(maxLine); - Field f = t.new Field(delim); - - int count = 0; - if(skipLines>0) { - trans.info().log("Skipping",skipLines,"line"+(skipLines==1?" in":"s in"),data.file().getName()); - } - for(int i=0;i0) { + trans.info().log("Skipping",skipLines,"line"+(skipLines==1?" in":"s in"),data.file().getName()); + } + for(int i=0;i