Commit d0bf532e authored by Florian Fittkau's avatar Florian Fittkau

...

parent f037035d
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/worker/src/explorviz/live_trace_processing/main/WorkerStarter.java"/>
<listEntry value="/analysis/src/explorviz/live_trace_processing/main/WorkerStarter.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
......@@ -10,6 +10,6 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="explorviz.live_trace_processing.main.WorkerStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="worker"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx4G -Dexplorviz.live_trace_processing.worker_enabled=false -Dexplorviz.live_trace_processing.reader_listening_port=10134"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="analysis"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx4G -Dexplorviz.live_trace_processing.worker_enabled=false -Dexplorviz.live_trace_processing.reader_listening_port=10135"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/analysis/src/explorviz/live_trace_processing/main/WorkerStarter.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="explorviz.live_trace_processing.main.WorkerStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="analysis"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx4G -Dexplorviz.live_trace_processing.worker_enabled=true -Dexplorviz.live_trace_processing.reader_listening_port=10134 -Dexplorviz.live_trace_processing.writer_target_port=10135"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/worker/src/explorviz/live_trace_processing/main/WorkerStarter.java"/>
<listEntry value="/analysis/src/explorviz/live_trace_processing/main/WorkerStarter.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
......@@ -10,6 +10,6 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="explorviz.live_trace_processing.main.WorkerStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="worker"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="analysis"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx4G -Dexplorviz.live_trace_processing.worker_enabled=true -Dexplorviz.live_trace_processing.reader_listening_port=10133 -Dexplorviz.live_trace_processing.writer_target_port=10134"/>
</launchConfiguration>
......@@ -25,7 +25,7 @@ import explorviz.live_trace_processing.writer.IStringRecordSender;
import explorviz.live_trace_processing.writer.IWriter;
public class TCPConnector extends AbstractSink implements IWriter, IStringRecordSender,
IRecordSender {
IRecordSender {
private URL providerURL;
private SocketChannel socketChannel;
......@@ -138,7 +138,6 @@ IRecordSender {
while (buffer.hasRemaining()) {
socketChannel.write(buffer);
}
doDisconnectIfNessecary();
} catch (final IOException e) {
System.out.println("WARNING: Connection was closed - possible data loss");
try {
......@@ -147,6 +146,7 @@ IRecordSender {
}
} finally {
buffer.clear();
doDisconnectIfNessecary();
}
}
......@@ -163,16 +163,16 @@ IRecordSender {
while (buffer.hasRemaining()) {
socketChannel.write(buffer);
}
doDisconnectIfNessecary();
} catch (final IOException e) {
System.out
.println("WARNING: Connection was closed during String sending - possible data loss");
.println("WARNING: Connection was closed during String sending - possible data loss");
try {
socketChannel.close();
} catch (final IOException e1) {
}
} finally {
buffer.clear();
doDisconnectIfNessecary();
}
}
......@@ -200,4 +200,12 @@ IRecordSender {
shouldDisconnect = true;
doDisconnectIfNessecary();
}
@Override
public boolean isDisconnected() {
if (socketChannel != null) {
return !socketChannel.isConnected();
}
return true;
}
}
......@@ -732,8 +732,10 @@ class TCPReaderOneClient implements Runnable {
final long usedRAM = buffer.getLong();
final long absoluteRAM = buffer.getLong();
putInQueue(new SystemMonitoringRecord(cpuUtil, usedRAM, absoluteRAM,
hostApplicationMetadata));
if (hostApplicationMetadata != null) {
putInQueue(new SystemMonitoringRecord(cpuUtil, usedRAM, absoluteRAM,
hostApplicationMetadata));
}
}
private final void readInBeforeConstructorEvent(final ByteBuffer buffer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment