Loading apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cache/Window.java +8 −8 Original line number Diff line number Diff line Loading @@ -23,14 +23,14 @@ import java.util.concurrent.atomic.AtomicInteger; /** * @author peng-yongsheng */ public abstract class Window<WindowCollection extends Collection> { public abstract class Window<WINDOW_COLLECTION extends Collection> { private AtomicInteger windowSwitch = new AtomicInteger(0); private WindowCollection pointer; private WINDOW_COLLECTION pointer; private WindowCollection windowDataA; private WindowCollection windowDataB; private WINDOW_COLLECTION windowDataA; private WINDOW_COLLECTION windowDataB; protected Window() { this.windowDataA = collectionInstance(); Loading @@ -38,7 +38,7 @@ public abstract class Window<WindowCollection extends Collection> { this.pointer = windowDataA; } public abstract WindowCollection collectionInstance(); public abstract WINDOW_COLLECTION collectionInstance(); public boolean trySwitchPointer() { return windowSwitch.incrementAndGet() == 1 && !getLast().isReading(); Loading @@ -57,7 +57,7 @@ public abstract class Window<WindowCollection extends Collection> { getLast().reading(); } protected WindowCollection getCurrentAndWriting() { protected WINDOW_COLLECTION getCurrentAndWriting() { if (pointer == windowDataA) { windowDataA.writing(); return windowDataA; Loading @@ -67,11 +67,11 @@ public abstract class Window<WindowCollection extends Collection> { } } protected WindowCollection getCurrent() { protected WINDOW_COLLECTION getCurrent() { return pointer; } public WindowCollection getLast() { public WINDOW_COLLECTION getLast() { if (pointer == windowDataA) { return windowDataB; } else { Loading Loading
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cache/Window.java +8 −8 Original line number Diff line number Diff line Loading @@ -23,14 +23,14 @@ import java.util.concurrent.atomic.AtomicInteger; /** * @author peng-yongsheng */ public abstract class Window<WindowCollection extends Collection> { public abstract class Window<WINDOW_COLLECTION extends Collection> { private AtomicInteger windowSwitch = new AtomicInteger(0); private WindowCollection pointer; private WINDOW_COLLECTION pointer; private WindowCollection windowDataA; private WindowCollection windowDataB; private WINDOW_COLLECTION windowDataA; private WINDOW_COLLECTION windowDataB; protected Window() { this.windowDataA = collectionInstance(); Loading @@ -38,7 +38,7 @@ public abstract class Window<WindowCollection extends Collection> { this.pointer = windowDataA; } public abstract WindowCollection collectionInstance(); public abstract WINDOW_COLLECTION collectionInstance(); public boolean trySwitchPointer() { return windowSwitch.incrementAndGet() == 1 && !getLast().isReading(); Loading @@ -57,7 +57,7 @@ public abstract class Window<WindowCollection extends Collection> { getLast().reading(); } protected WindowCollection getCurrentAndWriting() { protected WINDOW_COLLECTION getCurrentAndWriting() { if (pointer == windowDataA) { windowDataA.writing(); return windowDataA; Loading @@ -67,11 +67,11 @@ public abstract class Window<WindowCollection extends Collection> { } } protected WindowCollection getCurrent() { protected WINDOW_COLLECTION getCurrent() { return pointer; } public WindowCollection getLast() { public WINDOW_COLLECTION getLast() { if (pointer == windowDataA) { return windowDataB; } else { Loading