aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/server
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-06-29 13:27:49 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-29 14:59:58 +0200
commit61ecd282d1bef3cdce00199f3096cff290693019 (patch)
tree802fcf5cc0c58b7f54f6a103f090f9465b9e3c5f /src/main/java/com/google/devtools/build/lib/server
parent1c77ef6582305d96a3edcdcff1169298a9d9b062 (diff)
Fix a few style issues.
RELNOTES: None. PiperOrigin-RevId: 160510979
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/server')
-rw-r--r--src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java13
2 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
index b4ec495ed6..260273c4fc 100644
--- a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
+++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
@@ -507,12 +507,12 @@ public class GrpcServerImpl implements RPCServer {
private final PidFileWatcherThread pidFileWatcherThread;
private final Path pidFile;
private final String pidInFile;
+ private final List<Path> filesToDeleteAtExit = new ArrayList<>();
+ private final int port;
private Server server;
private IdleServerTasks idleServerTasks;
- private final int port;
boolean serving;
- private List<Path> filesToDeleteAtExit = new ArrayList<Path>();
public GrpcServerImpl(CommandExecutor commandExecutor, Clock clock, int port,
Path workspace, Path serverDirectory, int maxIdleSeconds) throws IOException {
diff --git a/src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java b/src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java
index fdca0177e1..db7cd4df0b 100644
--- a/src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java
+++ b/src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java
@@ -37,7 +37,7 @@ class IdleServerTasks {
private final Path workspaceDir;
private final ScheduledThreadPoolExecutor executor;
- private static final Logger LOG = Logger.getLogger(IdleServerTasks.class.getName());
+ private static final Logger log = Logger.getLogger(IdleServerTasks.class.getName());
private static final long FIVE_MIN_MILLIS = 1000 * 60 * 5;
@@ -60,7 +60,7 @@ class IdleServerTasks {
@SuppressWarnings("unused")
Future<?> possiblyIgnoredError =
executor.schedule(() -> {
- try (AutoProfiler p = AutoProfiler.logged("Idle GC", LOG)) {
+ try (AutoProfiler p = AutoProfiler.logged("Idle GC", log)) {
System.gc();
}
},
@@ -130,11 +130,12 @@ class IdleServerTasks {
try {
memInfo = new ProcMeminfoParser();
} catch (IOException e) {
- LOG.info("Could not process /proc/meminfo: " + e);
+ log.info("Could not process /proc/meminfo: " + e);
return true;
}
- long totalPhysical, totalFree;
+ long totalPhysical;
+ long totalFree;
try {
totalPhysical = memInfo.getTotalKb();
totalFree = memInfo.getFreeRamKb(); // See method javadoc.
@@ -149,8 +150,8 @@ class IdleServerTasks {
// If the system as a whole is low on memory, let this server die.
if (fractionFree < .1) {
- LOG.info("Terminating due to memory constraints");
- LOG.info(String.format("Total physical:%d\nTotal free: %d\n",
+ log.info("Terminating due to memory constraints");
+ log.info(String.format("Total physical:%d\nTotal free: %d\n",
totalPhysical, totalFree));
return false;
}