[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-db/master] Stop writing non-concatenated descriptor files.
commit 14edf87bc828956b934afa9d5e6b50b0556c3ddb
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Fri Aug 7 19:46:27 2015 +0200
Stop writing non-concatenated descriptor files.
We're not providing these files via HTTP, and we stopped rsync'ing
them locally when moving ExoneraTor to another host. No need to waste
all those fine inodes.
---
.../db/bridgedescs/SanitizedBridgesWriter.java | 15 ++++----------
.../ernie/db/relaydescs/ArchiveWriter.java | 21 ++++++--------------
2 files changed, 10 insertions(+), 26 deletions(-)
diff --git a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
index e4eb779..7311e9a 100644
--- a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
+++ b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
@@ -913,15 +913,11 @@ public class SanitizedBridgesWriter extends Thread {
+ "/" + descriptorDigest.charAt(0) + "/"
+ descriptorDigest.charAt(1) + "/"
+ descriptorDigest);
- File rsyncFile = new File(
- "rsync/bridge-descriptors/server-descriptors/"
- + tarballFile.getName());
File rsyncCatFile = new File("rsync/bridge-descriptors/"
+ "server-descriptors-cat/" + this.rsyncCatString
+ "-server-descriptors.tmp");
- File[] outputFiles = new File[] { tarballFile, rsyncFile,
- rsyncCatFile };
- boolean[] append = new boolean[] { false, false, true };
+ File[] outputFiles = new File[] { tarballFile, rsyncCatFile };
+ boolean[] append = new boolean[] { false, true };
try {
for (int i = 0; i < outputFiles.length; i++) {
File outputFile = outputFiles[i];
@@ -1190,13 +1186,10 @@ public class SanitizedBridgesWriter extends Thread {
+ descriptorDigest.charAt(0) + "/"
+ descriptorDigest.charAt(1) + "/"
+ descriptorDigest);
- File rsyncFile = new File("rsync/bridge-descriptors/extra-infos/"
- + tarballFile.getName());
File rsyncCatFile = new File("rsync/bridge-descriptors/"
+ "extra-infos-cat/" + this.rsyncCatString + "-extra-infos.tmp");
- File[] outputFiles = new File[] { tarballFile, rsyncFile,
- rsyncCatFile };
- boolean[] append = new boolean[] { false, false, true };
+ File[] outputFiles = new File[] { tarballFile, rsyncCatFile };
+ boolean[] append = new boolean[] { false, true };
try {
for (int i = 0; i < outputFiles.length; i++) {
File outputFile = outputFiles[i];
diff --git a/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java b/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java
index 521f877..1304cd5 100644
--- a/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java
+++ b/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java
@@ -464,14 +464,11 @@ public class ArchiveWriter extends Thread {
+ digest.substring(0, 1) + "/" + digest.substring(1, 2) + "/"
+ digest);
boolean tarballFileExistedBefore = tarballFile.exists();
- File rsyncFile = new File(
- "rsync/relay-descriptors/server-descriptors/" + digest);
File rsyncCatFile = new File("rsync/relay-descriptors/"
+ "server-descriptors-cat/" + this.rsyncCatString
+ "-server-descriptors.tmp");
- File[] outputFiles = new File[] { tarballFile, rsyncFile,
- rsyncCatFile };
- boolean[] append = new boolean[] { false, false, true };
+ File[] outputFiles = new File[] { tarballFile, rsyncCatFile };
+ boolean[] append = new boolean[] { false, true };
if (this.store(SERVER_DESCRIPTOR_ANNOTATION, data, outputFiles,
append)) {
this.storedServerDescriptorsCounter++;
@@ -499,13 +496,10 @@ public class ArchiveWriter extends Thread {
+ extraInfoDigest.substring(1, 2) + "/"
+ extraInfoDigest);
boolean tarballFileExistedBefore = tarballFile.exists();
- File rsyncFile = new File("rsync/relay-descriptors/extra-infos/"
- + extraInfoDigest);
File rsyncCatFile = new File("rsync/relay-descriptors/"
+ "extra-infos-cat/" + this.rsyncCatString + "-extra-infos.tmp");
- File[] outputFiles = new File[] { tarballFile, rsyncFile,
- rsyncCatFile };
- boolean[] append = new boolean[] { false, false, true };
+ File[] outputFiles = new File[] { tarballFile, rsyncCatFile };
+ boolean[] append = new boolean[] { false, true };
if (this.store(EXTRA_INFO_ANNOTATION, data, outputFiles, append)) {
this.storedExtraInfoDescriptorsCounter++;
}
@@ -538,14 +532,11 @@ public class ArchiveWriter extends Thread {
+ microdescriptorDigest.substring(1, 2) + "/"
+ microdescriptorDigest);
boolean tarballFileExistedBefore = tarballFile.exists();
- File rsyncFile = new File("rsync/relay-descriptors/microdescs/micro/"
- + microdescriptorDigest);
File rsyncCatFile = new File("rsync/relay-descriptors/"
+ "microdescs/micro-cat/" + this.rsyncCatString
+ "-micro.tmp");
- File[] outputFiles = new File[] { tarballFile, rsyncFile,
- rsyncCatFile };
- boolean[] append = new boolean[] { false, false, true };
+ File[] outputFiles = new File[] { tarballFile, rsyncCatFile };
+ boolean[] append = new boolean[] { false, true };
if (this.store(MICRODESCRIPTOR_ANNOTATION, data, outputFiles,
append)) {
this.storedMicrodescriptorsCounter++;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits