aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-05-29 00:54:39 -0400
committerEike Stepper2018-05-29 00:54:39 -0400
commitc47abbf4d18cd502b15df147faa0dbc4fffeffc2 (patch)
tree441a36e12d2596dd28e89c0ed1d4d645f0373353
parenta3930ccd6c0761d2f2c8c7dfce6725ce8d531156 (diff)
downloadcdo-c47abbf4d18cd502b15df147faa0dbc4fffeffc2.zip
cdo-c47abbf4d18cd502b15df147faa0dbc4fffeffc2.tar.gz
cdo-c47abbf4d18cd502b15df147faa0dbc4fffeffc2.tar.xz
[535161] Implement a buffer tracer
https://bugs.eclipse.org/bugs/show_bug.cgi?id=535161
-rw-r--r--plugins/org.eclipse.net4j.trace/src/org/eclipse/net4j/internal/trace/BufferTracer.java12
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/log/RollingLog.java55
-rw-r--r--releng/org.eclipse.emf.cdo.releng/CDO.setup2
3 files changed, 33 insertions, 36 deletions
diff --git a/plugins/org.eclipse.net4j.trace/src/org/eclipse/net4j/internal/trace/BufferTracer.java b/plugins/org.eclipse.net4j.trace/src/org/eclipse/net4j/internal/trace/BufferTracer.java
index ef9acb1..5ab56f3 100644
--- a/plugins/org.eclipse.net4j.trace/src/org/eclipse/net4j/internal/trace/BufferTracer.java
+++ b/plugins/org.eclipse.net4j.trace/src/org/eclipse/net4j/internal/trace/BufferTracer.java
@@ -16,11 +16,8 @@ import org.eclipse.net4j.trace.Element;
import org.eclipse.net4j.trace.Element.BufferElement;
import org.eclipse.net4j.trace.Element.ThreadElement;
import org.eclipse.net4j.trace.Listener;
-import org.eclipse.net4j.util.collection.CloseableIterator;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.RollingLog;
-import org.eclipse.net4j.util.om.log.RollingLog.LogLine;
import java.util.Stack;
@@ -52,15 +49,6 @@ public class BufferTracer
}
}
- public static void main(String[] args)
- {
- for (CloseableIterator<LogLine> it = RollingLog.iterator("C:\\Develop\\cdo-master\\trace"); it.hasNext();)
- {
- LogLine logLine = it.next();
- System.out.println(logLine);
- }
- }
-
public static Stack<Call> execution(Object object, String method, Stack<Call> callStack)
{
if (EXECUTION.get() == null)
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/log/RollingLog.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/log/RollingLog.java
index ae1c2cf..6acd18a 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/log/RollingLog.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/log/RollingLog.java
@@ -451,6 +451,15 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
return new LogIterator(logFile, 0);
}
+ public static void main(String[] args)
+ {
+ for (CloseableIterator<LogLine> it = iterator(args[0]); it.hasNext();)
+ {
+ LogLine logLine = it.next();
+ System.out.println(logLine);
+ }
+ }
+
private static File getFile(String logFile, int fileNumber)
{
return new File(logFile + String.format("-%04d", fileNumber) + ".txt");
@@ -462,19 +471,19 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
private static final class LogIterator extends AbstractIterator<LogLine> implements CloseableIterator<LogLine>
{
private static final int CLOSED = -1;
-
+
private final String logFile;
-
+
private int fileNumber;
-
+
private BufferedReader reader;
-
+
public LogIterator(String logFile, int fileNumber)
{
this.logFile = logFile;
this.fileNumber = fileNumber;
}
-
+
@Override
protected Object computeNextElement()
{
@@ -482,7 +491,7 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
{
return END_OF_DATA;
}
-
+
if (reader == null)
{
File file = getFile(logFile, fileNumber++);
@@ -503,7 +512,7 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
return END_OF_DATA;
}
}
-
+
try
{
String string = reader.readLine();
@@ -513,7 +522,7 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
reader = null;
return computeNextElement();
}
-
+
return new LogLine(string);
}
catch (IOException ex)
@@ -522,14 +531,14 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
return END_OF_DATA;
}
}
-
+
public void close()
{
IOUtil.close(reader);
reader = null;
fileNumber = CLOSED;
}
-
+
public boolean isClosed()
{
return fileNumber == CLOSED;
@@ -542,26 +551,26 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
public static final class LogLine
{
private static final String NL = "\n\r";
-
+
private static final String TAB = "\t";
-
+
private static final String TABNL = TAB + NL;
-
+
private long id;
-
+
private final long millis;
-
+
private final String thread;
-
+
private final String message;
-
+
public LogLine(long millis, String thread, String message)
{
this.millis = millis;
this.thread = StringUtil.translate(thread, TABNL, " ");
this.message = StringUtil.translate(message, NL, " ");
}
-
+
public LogLine(String string)
{
StringTokenizer tokenizer = new StringTokenizer(string, TAB);
@@ -570,27 +579,27 @@ public class RollingLog extends Worker implements Log, Iterable<LogLine>
thread = tokenizer.nextToken();
message = tokenizer.nextToken("").substring(1);
}
-
+
public long getID()
{
return id;
}
-
+
public long getMillis()
{
return millis;
}
-
+
public String getThread()
{
return thread;
}
-
+
public String getMessage()
{
return message;
}
-
+
@Override
public String toString()
{
diff --git a/releng/org.eclipse.emf.cdo.releng/CDO.setup b/releng/org.eclipse.emf.cdo.releng/CDO.setup
index bb3bf9c..0b89d1d 100644
--- a/releng/org.eclipse.emf.cdo.releng/CDO.setup
+++ b/releng/org.eclipse.emf.cdo.releng/CDO.setup
@@ -665,7 +665,7 @@
xsi:type="setup:VariableTask"
type="URI"
name="aspectj.repository"
- value="http://download.eclipse.org/tools/ajdt/47_aj9/dev/update"/>
+ value="http://download.eclipse.org/tools/ajdt/48/dev/update"/>
<setupTask
xsi:type="setup:VariableTask"
name="INSTALL_AJDT"