Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<ebean.annotation.version>8.4</ebean.annotation.version>
<jakarta.persistence.api.version>3.0</jakarta.persistence.api.version>
<flyway.version>11.7.2</flyway.version>
<guava.version>33.3.0-jre</guava.version>
<guava.version>33.4.8-jre</guava.version>
<guice.version>7.0.0</guice.version>
<hamcrest.version>3.0</hamcrest.version>
<hikari.version>5.1.0</hikari.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import com.arpnetworking.metrics.Metrics;
import com.arpnetworking.metrics.MetricsFactory;
import com.arpnetworking.tsdcore.model.AggregatedData;
import com.google.common.base.Charsets;
import com.google.common.collect.Maps;
import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

import java.nio.charset.StandardCharsets;
import java.time.ZonedDateTime;
import java.util.Map;

Expand Down Expand Up @@ -141,21 +141,21 @@ public long getStatisticsLatestPeriod() {

private BloomFilter<CharSequence> createServicesBF() {
return BloomFilter.create(
Funnels.stringFunnel(Charsets.UTF_8),
Funnels.stringFunnel(StandardCharsets.UTF_8),
10_000,
0.001);
}

private BloomFilter<CharSequence> createMetricsBF() {
return BloomFilter.create(
Funnels.stringFunnel(Charsets.UTF_8),
Funnels.stringFunnel(StandardCharsets.UTF_8),
1_000_000,
0.001);
}

private BloomFilter<CharSequence> createStatisticsBF() {
return BloomFilter.create(
Funnels.stringFunnel(Charsets.UTF_8),
Funnels.stringFunnel(StandardCharsets.UTF_8),
10_000_000,
0.005);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import com.arpnetworking.commons.jackson.databind.ObjectMapperFactory;
import com.arpnetworking.steno.Logger;
import com.arpnetworking.steno.LoggerFactory;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.NotNull;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
* Represents the model for the version of the service currently running.
Expand Down Expand Up @@ -67,7 +67,7 @@ private VersionInfo(final Builder builder) {
try {
versionInfo =
ObjectMapperFactory.getInstance().readValue(
Resources.toString(Resources.getResource("version.json"), Charsets.UTF_8),
Resources.toString(Resources.getResource("version.json"), StandardCharsets.UTF_8),
VersionInfo.class);
} catch (final IOException e) {
LOGGER.error()
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/arpnetworking/tsdcore/sinks/CarbonSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
import com.arpnetworking.steno.LoggerFactory;
import com.arpnetworking.tsdcore.model.AggregatedData;
import com.arpnetworking.tsdcore.model.PeriodicData;
import com.google.common.base.Charsets;
import org.apache.pekko.util.ByteString;
import org.apache.pekko.util.ByteStringBuilder;

import java.nio.charset.StandardCharsets;

/**
* Publisher to send data to a Carbon server.
*
Expand All @@ -46,7 +47,7 @@ protected ByteString serializeData(final PeriodicData periodicData) {
datum.getFQDSN().getStatistic().getName(),
datum.getValue().getValue(),
periodicData.getStart().toEpochSecond())
.getBytes(Charsets.UTF_8));
.getBytes(StandardCharsets.UTF_8));
}
return builder.result();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.arpnetworking.tsdcore.model.PeriodicData;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.NotNull;
Expand All @@ -33,6 +32,7 @@
import org.asynchttpclient.Request;
import org.asynchttpclient.RequestBuilder;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -96,7 +96,7 @@ protected Collection<SerializedDatum> serialize(final PeriodicData periodicData)
return Collections.emptyList();
}
return Collections.singletonList(new SerializedDatum(
dataDogDataAsJson.getBytes(Charsets.UTF_8),
dataDogDataAsJson.getBytes(StandardCharsets.UTF_8),
Optional.empty()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.arpnetworking.steno.LoggerFactory;
import com.arpnetworking.tsdcore.model.PeriodicData;
import com.arpnetworking.tsdcore.model.RequestEntry;
import com.google.common.base.Charsets;
import com.google.common.collect.EvictingQueue;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand All @@ -36,6 +35,7 @@
import org.asynchttpclient.Response;
import scala.concurrent.duration.FiniteDuration;

import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.Instant;
import java.util.Collection;
Expand Down Expand Up @@ -201,7 +201,7 @@ public Receive createReceive() {
if (_retryableStatusCodes.contains(response.getStatusCode()) && attempt < _sink.getMaximumAttempts()) {
final byte[] requestBodyBytes = rejected.getRequestEntry().getRequest().getByteData();
// CHECKSTYLE.OFF: IllegalInstantiation - This is ok for String from byte[]
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, Charsets.UTF_8);
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, StandardCharsets.UTF_8);
// CHECKSTYLE.ON: IllegalInstantiation
POST_RETRY_LOGGER.warn()
.setMessage("Attempt rejected")
Expand Down Expand Up @@ -298,7 +298,7 @@ private void processRejectedRequest(final PostRejected rejected) {

final byte[] requestBodyBytes = rejected.getRequestEntry().getRequest().getByteData();
// CHECKSTYLE.OFF: IllegalInstantiation - This is ok for String from byte[]
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, Charsets.UTF_8);
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, StandardCharsets.UTF_8);
// CHECKSTYLE.ON: IllegalInstantiation
POST_ERROR_LOGGER.warn()
.setMessage("Post rejected")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/arpnetworking/tsdcore/sinks/RrdSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.arpnetworking.steno.LoggerFactory;
import com.arpnetworking.tsdcore.model.AggregatedData;
import com.arpnetworking.tsdcore.model.PeriodicData;
import com.google.common.base.Charsets;
import com.google.common.base.Joiner;
import com.google.common.collect.Maps;
import net.sf.oval.constraint.NotEmpty;
Expand All @@ -31,6 +30,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.HashMap;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -208,7 +208,7 @@ private void executeProcess(final String[] args) {
proecssBuilder.redirectErrorStream(true);
final Process process = proecssBuilder.start();
try (BufferedReader processStandardOut = new BufferedReader(
new InputStreamReader(process.getInputStream(), Charsets.UTF_8))) {
new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8))) {
String line;
final StringBuilder processOutput = new StringBuilder();
while ((line = processStandardOut.readLine()) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.typesafe.config.ConfigFactory;
import com.typesafe.sslconfig.ssl.SSLConfigSettings;
import net.sf.oval.constraint.NotNull;
Expand All @@ -44,6 +43,7 @@

import java.io.IOException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletionStage;
Expand Down Expand Up @@ -279,7 +279,7 @@ private CompletionStage<? extends StandaloneWSResponse> fireRequest(final Standa
}

private InMemoryBodyWritable createBody(final String bodyString) {
return new InMemoryBodyWritable(ByteString.fromString(bodyString, Charsets.UTF_8), "application/json");
return new InMemoryBodyWritable(ByteString.fromString(bodyString, StandardCharsets.UTF_8), "application/json");
}

private CirconusClient(final Builder builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
package com.arpnetworking.configuration;

import com.arpnetworking.configuration.triggers.DirectoryTrigger;
import com.google.common.base.Charsets;
import com.google.common.base.MoreObjects;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -112,7 +112,7 @@ public void testDirectoryChangedFileCreated() throws IOException, InterruptedExc
Assert.assertTrue(trigger.evaluateAndReset());
Assert.assertFalse(trigger.evaluateAndReset());

Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));

Assert.assertTrue(trigger.evaluateAndReset());
}
Expand All @@ -134,7 +134,7 @@ public void testDirectoryChangedFileModified() throws IOException, InterruptedEx

// Ensure file system modified time reflects the change
Thread.sleep(1000);
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));

Assert.assertTrue(trigger.evaluateAndReset());
}
Expand All @@ -145,7 +145,7 @@ public void testDirectoryChangedFileDeleted() throws IOException, InterruptedExc
deleteDirectory(directory);
Files.createDirectory(directory.toPath());
final File file = directory.toPath().resolve("foo.txt").toFile();
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));

final Trigger trigger = new DirectoryTrigger.Builder()
.setDirectory(directory)
Expand Down Expand Up @@ -173,10 +173,10 @@ public void testOnlyMatchedName() throws IOException, InterruptedException {
Assert.assertTrue(trigger.evaluateAndReset());
Assert.assertFalse(trigger.evaluateAndReset());

Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));
Assert.assertFalse(trigger.evaluateAndReset());

Files.write(directory.toPath().resolve("bar.txt"), "bar".getBytes(Charsets.UTF_8));
Files.write(directory.toPath().resolve("bar.txt"), "bar".getBytes(StandardCharsets.UTF_8));
Assert.assertTrue(trigger.evaluateAndReset());
}

Expand All @@ -194,10 +194,10 @@ public void testOnlyMatchedNamePattern() throws IOException, InterruptedExceptio
Assert.assertTrue(trigger.evaluateAndReset());
Assert.assertFalse(trigger.evaluateAndReset());

Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));
Assert.assertFalse(trigger.evaluateAndReset());

Files.write(directory.toPath().resolve("foo.json"), "bar".getBytes(Charsets.UTF_8));
Files.write(directory.toPath().resolve("foo.json"), "bar".getBytes(StandardCharsets.UTF_8));
Assert.assertTrue(trigger.evaluateAndReset());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
package com.arpnetworking.configuration;

import com.arpnetworking.configuration.triggers.FileTrigger;
import com.google.common.base.Charsets;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.attribute.FileTime;

Expand Down Expand Up @@ -116,7 +116,7 @@ public void testFileCreated() throws IOException {
public void testFileChanged() throws IOException, InterruptedException {
final File file = new File("./target/tmp/test/FileTriggerTest/testFileChanged");
Files.deleteIfExists(file.toPath());
Files.write(file.toPath(), "foo".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "foo".getBytes(StandardCharsets.UTF_8));

final Trigger trigger = new FileTrigger.Builder()
.setFile(file)
Expand All @@ -127,7 +127,7 @@ public void testFileChanged() throws IOException, InterruptedException {

// Ensure file system modified time reflects the change
Thread.sleep(1000);
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));

Assert.assertTrue(trigger.evaluateAndReset());
}
Expand All @@ -136,7 +136,7 @@ public void testFileChanged() throws IOException, InterruptedException {
public void testFileChangedLastModifiedOnly() throws IOException {
final File file = new File("./target/tmp/test/FileTriggerTest/testFileChangedLastModifiedOnly");
Files.deleteIfExists(file.toPath());
Files.write(file.toPath(), "foo".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "foo".getBytes(StandardCharsets.UTF_8));
Files.setLastModifiedTime(file.toPath(), FileTime.fromMillis(1418112007000L));

final Trigger trigger = new FileTrigger.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.arpnetworking.configuration.jackson;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableSet;
import com.typesafe.config.impl.ConfigImpl;
import org.junit.Assert;
Expand All @@ -24,6 +23,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.attribute.PosixFilePermission;

Expand Down Expand Up @@ -54,7 +54,7 @@ public void testFileDoesNotExist() throws IOException {
@Test
public void testFileUnreadable() throws IOException {
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testFileUnreadable.json");
Files.write(file.toPath(), "foo=\"bar\"".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "foo=\"bar\"".getBytes(StandardCharsets.UTF_8));
Files.setPosixFilePermissions(file.toPath(), ImmutableSet.of(PosixFilePermission.OWNER_WRITE));
final HoconFileSource source = new HoconFileSource.Builder()
.setFile(file)
Expand All @@ -65,7 +65,7 @@ public void testFileUnreadable() throws IOException {
@Test
public void testValidHocon() throws IOException {
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testValidHocon.hocon");
Files.write(file.toPath(), "foo:\"bar\"".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "foo:\"bar\"".getBytes(StandardCharsets.UTF_8));
final HoconFileSource source = new HoconFileSource.Builder()
.setFile(file)
.build();
Expand All @@ -77,7 +77,7 @@ public void testValidHocon() throws IOException {
@Test
public void testSystemPropertyDirect() throws IOException {
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testSystemPropertyDirect.hocon");
Files.write(file.toPath(), "".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8));
final HoconFileSource source = new HoconFileSource.Builder()
.setFile(file)
.build();
Expand All @@ -88,7 +88,7 @@ public void testSystemPropertyDirect() throws IOException {
@Test
public void testSystemPropertyReference() throws IOException {
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testSystemPropertyReference.hocon");
Files.write(file.toPath(), "foo:${HoconFileSourceTest_testSystemPropertyReference_foo}".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "foo:${HoconFileSourceTest_testSystemPropertyReference_foo}".getBytes(StandardCharsets.UTF_8));
final HoconFileSource source = new HoconFileSource.Builder()
.setFile(file)
.build();
Expand All @@ -99,7 +99,7 @@ public void testSystemPropertyReference() throws IOException {
@Test(expected = RuntimeException.class)
public void testInvalidHocon() throws IOException {
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testInvalidHocon.json");
Files.write(file.toPath(), "This=\"not-hocon".getBytes(Charsets.UTF_8));
Files.write(file.toPath(), "This=\"not-hocon".getBytes(StandardCharsets.UTF_8));
new HoconFileSource.Builder()
.setFile(file)
.build();
Expand Down
Loading