|
@@ -26,7 +26,6 @@ import java.io.InputStreamReader;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Queue;
|
|
import java.util.Queue;
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
-import java.util.concurrent.CountDownLatch;
|
|
|
|
|
import java.util.concurrent.TimeoutException;
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
|
|
|
|
public class SparkerSession implements Session {
|
|
public class SparkerSession implements Session {
|
|
@@ -50,8 +49,6 @@ public class SparkerSession implements Session {
|
|
|
|
|
|
|
|
this.process = pb.start();
|
|
this.process = pb.start();
|
|
|
|
|
|
|
|
- final CountDownLatch latch = new CountDownLatch(1);
|
|
|
|
|
-
|
|
|
|
|
this.readerThread = new Thread(new Runnable() {
|
|
this.readerThread = new Thread(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -60,15 +57,6 @@ public class SparkerSession implements Session {
|
|
|
try {
|
|
try {
|
|
|
String line;
|
|
String line;
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- while ((line = reader.readLine()) != null) {
|
|
|
|
|
- outputLines.add(line);
|
|
|
|
|
- if (line.equals("Spark context available as sc.")) {
|
|
|
|
|
- latch.countDown();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- */
|
|
|
|
|
-
|
|
|
|
|
while ((line = reader.readLine()) != null) {
|
|
while ((line = reader.readLine()) != null) {
|
|
|
outputLines.add(line);
|
|
outputLines.add(line);
|
|
|
}
|
|
}
|
|
@@ -83,8 +71,6 @@ public class SparkerSession implements Session {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
readerThread.start();
|
|
readerThread.start();
|
|
|
-
|
|
|
|
|
- //latch.await();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -129,8 +115,7 @@ public class SparkerSession implements Session {
|
|
|
protected long lastActivity = Long.MAX_VALUE;
|
|
protected long lastActivity = Long.MAX_VALUE;
|
|
|
|
|
|
|
|
public void touchLastActivity() {
|
|
public void touchLastActivity() {
|
|
|
- long now = System.currentTimeMillis();
|
|
|
|
|
- this.lastActivity = now;
|
|
|
|
|
|
|
+ this.lastActivity = System.currentTimeMillis();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public long getLastActivity() {
|
|
public long getLastActivity() {
|