small enhancements
This commit is contained in:
@@ -5,6 +5,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
|
||||
import org.lucares.performance.db.PerformanceDb;
|
||||
@@ -33,7 +34,8 @@ public class Ingestor {
|
||||
}
|
||||
|
||||
public static void main(final String[] args) throws LiquibaseException, Exception {
|
||||
final Path dataDirectory = Files.createTempDirectory("ingestor");
|
||||
final Path dataDirectory = Paths.get("/tmp/ingestor");
|
||||
Files.createDirectories(dataDirectory);
|
||||
final File logFile = new File(
|
||||
"/home/andi/ws/performanceDb/data/production/ondem/ondem01/ap001/1_performance.log");
|
||||
|
||||
|
||||
@@ -41,13 +41,13 @@ public class PerformanceLogs {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
final Entry entry = filter.parse(line, tags);
|
||||
if (entry != null) {
|
||||
System.out.println(entry);
|
||||
queue.put(entry);
|
||||
}
|
||||
}
|
||||
|
||||
result = true;
|
||||
} finally {
|
||||
System.out.println("added poison");
|
||||
queue.put(Entry.POISON);
|
||||
}
|
||||
return result;
|
||||
@@ -60,11 +60,11 @@ public class PerformanceLogs {
|
||||
} catch (ExecutionException | TimeoutException e) {
|
||||
e.printStackTrace(); // TODO @ahr handle this mess
|
||||
}
|
||||
} catch (final RuntimeException e) {
|
||||
} catch (final Exception e) {
|
||||
future.cancel(true);
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
executor.awaitTermination(10, TimeUnit.MINUTES);
|
||||
executor.awaitTermination(10, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user