Skip to content

Commit

Permalink
chore: small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bluestreak01 committed Oct 26, 2023
1 parent 194bae0 commit 14326f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/io/questdb/cutlass/Services.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ public HttpRequestProcessor newInstance() {
}, true);
if (metrics.isEnabled()) {
final PrometheusMetricsProcessor.RequestStatePool pool = new PrometheusMetricsProcessor.RequestStatePool(
configuration.getWorkerCount());
configuration.getWorkerCount()
);
server.registerClosable(pool);
server.bind(new HttpRequestProcessorFactory() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
import io.questdb.metrics.Scrapable;
import io.questdb.network.PeerDisconnectedException;
import io.questdb.network.PeerIsSlowToReadException;
import io.questdb.std.Files;
import io.questdb.std.Mutable;
import io.questdb.std.ObjList;
import io.questdb.std.QuietCloseable;
import io.questdb.std.*;
import io.questdb.std.str.DirectByteCharSink;
import org.jetbrains.annotations.TestOnly;

Expand Down Expand Up @@ -172,10 +169,7 @@ public synchronized int size() {

@Override
public void close() {
for (int i = 0, n = objects.size(); i < n; i++) {
objects.getQuick(i).free();
}
objects.clear();
Misc.freeObjListAndClear(objects);
}

public synchronized void push(RequestState requestState) {
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/io/questdb/std/bytes/DirectByteSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package io.questdb.std.bytes;

import io.questdb.std.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;

import java.nio.BufferOverflowException;
Expand Down Expand Up @@ -150,7 +151,7 @@ public long book(long required) {
}

@Override
public NativeByteSink borrowDirectByteSink() {
public @NotNull NativeByteSink borrowDirectByteSink() {
lastCapacity = capacity();
return byteSink;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected int memoryTag() {
}

@Override
public NativeByteSink borrowDirectByteSink() {
public @NotNull NativeByteSink borrowDirectByteSink() {
return sink.borrowDirectByteSink();
}

Expand Down

0 comments on commit 14326f2

Please sign in to comment.