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
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private static String getKey(String uri, Map<String, Object> httpConfig) {
* shutdown, hence it is okay for us to make the threads daemon.
*/
private class DaemonNamedThreadFactory extends NamedThreadFactory {
public DaemonNamedThreadFactory(String name) {
DaemonNamedThreadFactory(String name) {
super(name + " " + StringUtils.substringAfterLast(_logger.getName(), "."));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* DatastreamRestClient, without doing a major refactoring of the code.
*/
public final class DatastreamRestClientFactory {

private DatastreamRestClientFactory() {
}

private static final Logger LOG = LoggerFactory.getLogger(DatastreamRestClientFactory.class);
private static final BaseRestClientFactory<DatastreamRestClient> FACTORY =
new BaseRestClientFactory<>(DatastreamRestClient.class, LOG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Factory class for obtaining {@link ServerComponentHealthRestClient} objects.
*/
public final class ServerComponentHealthRestClientFactory {

private ServerComponentHealthRestClientFactory() {
}

private static final Logger LOG = LoggerFactory.getLogger(DatastreamRestClientFactory.class);
private static final BaseRestClientFactory<ServerComponentHealthRestClient> FACTORY =
new BaseRestClientFactory<>(ServerComponentHealthRestClient.class, LOG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
/**
* Utility class to simplify Avro message encoding
*/
public class AvroMessageEncoderUtil {
public final class AvroMessageEncoderUtil {

private AvroMessageEncoderUtil() {
}

public static final byte MAGIC_BYTE = 0x0;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
/**
* Constants used in the metadata field of {@link BrooklinEnvelope}
*/
public class BrooklinEnvelopeMetadataConstants {
public final class BrooklinEnvelopeMetadataConstants {

private BrooklinEnvelopeMetadataConstants() {
}

/**
* Codes to identify the different data change operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
/**
* Various well known config keys used in datastream metadata.
*/
public class DatastreamMetadataConstants {
public final class DatastreamMetadataConstants {

private DatastreamMetadataConstants() {
}

/**
* Represents whether the datastream has an User managed destination (a.k.a BYOT - Bring your own topic)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
* for checking the
*/
public final class JsonUtils {

private JsonUtils() {
}

private static final Logger LOG = LoggerFactory.getLogger(JsonUtils.class.getName());

private static final ObjectMapper MAPPER = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
/**
* Utility class to simplify usage of Java reflection.
*/
public class ReflectionUtils {
public final class ReflectionUtils {

private ReflectionUtils() {
}

private static final Logger LOG = LoggerFactory.getLogger(ReflectionUtils.class);

private static final Class<?>[][] COMPATIBLE_TYPES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DatabaseChunkedReaderMetrics extends BrooklinMetrics {
* @param source Aggregate metrics for source .i.e. at the Database table level
* @param key Metrics at the reader level, identified by key
*/
public DatabaseChunkedReaderMetrics(String source, String key) {
DatabaseChunkedReaderMetrics(String source, String key) {
super(CLASS_NAME, key);
_source = source;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static class EventProcMetrics extends BrooklinMetrics {
final Meter _aggregatedErrorRate;
final Meter _aggregatedProcessingAboveThreshold;

public EventProcMetrics(String className, String key) {
EventProcMetrics(String className, String key) {
super(className, key);
_lastEventReceivedTime = Instant.now();
_eventsProcessedRate = DYNAMIC_METRICS_MANAGER.registerMetric(_className, _key, EVENTS_PROCESSED_RATE,
Expand Down Expand Up @@ -139,7 +139,7 @@ static class PollMetrics extends BrooklinMetrics {
final Counter _aggregatedClientPollOverTimeout;
final Counter _aggregatedClientPollIntervalOverSessionTimeout;

public PollMetrics(String className, String key) {
PollMetrics(String className, String key) {
super(className, key);
_numPolls = DYNAMIC_METRICS_MANAGER.registerMetric(_className, _key, NUM_POLLS, Meter.class);
_eventCountsPerPoll = DYNAMIC_METRICS_MANAGER.registerMetric(_className, _key, EVENT_COUNTS_PER_POLL,
Expand Down Expand Up @@ -203,7 +203,7 @@ static class PartitionMetrics extends BrooklinMetrics {
private final AtomicLong _numPartitions;
private final AtomicLong _numStuckPartitions;

public PartitionMetrics(String className, String key) {
PartitionMetrics(String className, String key) {
super(className, key);
_fullMetricsKey = MetricRegistry.name(_className, _key);
_rebalanceRate = DYNAMIC_METRICS_MANAGER.registerMetric(_className, _key, REBALANCE_RATE, Meter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
/**
* Metadata constants that are specific to Kafka (or Kafka MirrorMaker) datastreams.
*/
public class KafkaDatastreamMetadataConstants {
public final class KafkaDatastreamMetadataConstants {

private KafkaDatastreamMetadataConstants() {
}

// Can be used by the transport provider to send to a particular Kafka cluster
public static final String DESTINATION_KAFKA_BROKERS = "system.destination.KafkaBrokers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Manages dynamic metrics and supports creating/updating metrics on the fly.
*/
public class DynamicMetricsManager {
public final class DynamicMetricsManager {
static final String NO_KEY_PLACEHOLDER = "NO_KEY";
private static final Logger LOG = LoggerFactory.getLogger(DynamicMetricsManager.class);
private static DynamicMetricsManager _instance = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
* A factory for {@link JmxReporter} objects that generates metrics whose
* names are decided according to {@link BrooklinObjectNameFactory}.
*/
public class JmxReporterFactory {
public final class JmxReporterFactory {

private JmxReporterFactory() {
}

private static final ObjectNameFactory OBJECT_NAME_FACTORY = new BrooklinObjectNameFactory();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
class ResettableGauge<T> implements Gauge<T> {
private Supplier<T> _supplier;

public ResettableGauge() {
ResettableGauge() {
}

public ResettableGauge(Supplier<T> supplier) {
ResettableGauge(Supplier<T> supplier) {
_supplier = supplier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FileProcessor implements Runnable {
private boolean _cancelRequested;
private boolean _isStopped;

public FileProcessor(DatastreamTask datastreamTask, DatastreamEventProducer producer) throws FileNotFoundException {
FileProcessor(DatastreamTask datastreamTask, DatastreamEventProducer producer) throws FileNotFoundException {
_task = datastreamTask;
_fileName = datastreamTask.getDatastreamSource().getConnectionString();
_positionKey = new FilePositionKey(_task.getTaskPrefix(), _task.getDatastreamTaskName(), Instant.now(), _fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ public Map<String, Map<Integer, Long>> getConsumptionLagForTask(DatastreamTask t
/**
* {@inheritDoc}
*/
@Override
public List<String> getActiveTasks() {
List<DatastreamTask> tasks = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
/**
* Utility class for Kafka based connectors
*/
public class KafkaConnectorDiagUtils {
public final class KafkaConnectorDiagUtils {

private KafkaConnectorDiagUtils() {
}

/**
* Reduce/Merge the KafkaTopicPartitionStatsResponse responses of a collection of host/instance into one response
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private void validateSourceConnectionString(Datastream stream) throws Datastream
* PartitionDiscoveryThread listens to Kafka partitions periodically using the _consumer.listTopic()
* to fetch the latest subscribed partitions for a given datastreamGroup
*/
class PartitionDiscoveryThread extends Thread {
final class PartitionDiscoveryThread extends Thread {
// The datastream group that this partitionDiscoveryThread is responsible to handle
private final DatastreamGroup _datastreamGroup;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
public final class KafkaMirrorMakerDatastreamMetadata {

private KafkaMirrorMakerDatastreamMetadata() {
}

public static final String IDENTITY_PARTITIONING_ENABLED = "system.destination.identityPartitioningEnabled";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
/**
* Utility methods for {@link KafkaTransportProvider}
*/
public class KafkaTransportProviderUtils {
public final class KafkaTransportProviderUtils {

private KafkaTransportProviderUtils() {
}

private static final Logger LOG = LoggerFactory.getLogger(KafkaTransportProviderUtils.class.getName());
// Mapping destination URI to topic name
private final static Map<String, String> URI_TOPICS = new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,7 @@ private static class CoordinatorMetrics {
private final List<BrooklinMetricInfo> _metricInfos;
private final DynamicMetricsManager _dynamicMetricsManager;

public CoordinatorMetrics(Coordinator coordinator) {
CoordinatorMetrics(Coordinator coordinator) {
_coordinator = coordinator;
_metricInfos = new ArrayList<>();
_dynamicMetricsManager = DynamicMetricsManager.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
*/
public final class DatastreamServerConfigurationConstants {

private DatastreamServerConfigurationConstants() {
}

public static final String CONFIG_PREFIX = "brooklin.server.";
public static final String CONFIG_CONNECTOR_NAMES = CONFIG_PREFIX + "connectorNames";
public static final String CONFIG_HTTP_PORT = CONFIG_PREFIX + "httpPort";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private static class ElasticTaskAssignmentInfo {
private final int _actualPartitionsPerTask;
private final boolean _needsAdjustment;

public ElasticTaskAssignmentInfo(int actualPartitionsPerTask, boolean needsAdjustment) {
ElasticTaskAssignmentInfo(int actualPartitionsPerTask, boolean needsAdjustment) {
_actualPartitionsPerTask = actualPartitionsPerTask;
_needsAdjustment = needsAdjustment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ private class ZkBackedDMSDatastreamList implements IZkChildListener, IZkDataList
/**
* Sets up a watch on the {@code /{cluster}/dms} tree, so it can be notified of future changes.
*/
public ZkBackedDMSDatastreamList() {
ZkBackedDMSDatastreamList() {
_path = KeyBuilder.datastreams(_cluster);
_zkclient.ensurePath(KeyBuilder.datastreams(_cluster));
LOG.info("ZkBackedDMSDatastreamList::Subscribing to the changes under the path " + _path);
Expand Down Expand Up @@ -1768,7 +1768,7 @@ private class ZkBackedLiveInstanceListProvider implements IZkChildListener {
* Sets up a watch on the {@code /{cluster}/liveinstances} tree, so it can be notified
* of future changes.
*/
public ZkBackedLiveInstanceListProvider() {
ZkBackedLiveInstanceListProvider() {
_path = KeyBuilder.liveInstances(_cluster);
_zkclient.ensurePath(_path);
LOG.info("ZkBackedLiveInstanceListProvider::Subscribing to the under the path " + _path);
Expand Down Expand Up @@ -1850,7 +1850,7 @@ private class ZkBackedTaskListProvider implements IZkChildListener, IZkDataListe
* Constructor
* @param instanceName Instance for which the datastream task assignment is to be watched.
*/
public ZkBackedTaskListProvider(String cluster, String instanceName) {
ZkBackedTaskListProvider(String cluster, String instanceName) {
_path = KeyBuilder.instanceAssignments(cluster, instanceName);
LOG.info("ZkBackedTaskListProvider::Subscribing to the changes under the path " + _path);
_zkclient.subscribeChildChanges(_path, this);
Expand Down Expand Up @@ -1901,7 +1901,7 @@ private class ZkTargetAssignmentProvider implements IZkDataListener {
/**
* Constructor
*/
public ZkTargetAssignmentProvider(Set<String> connectorTypes) {
ZkTargetAssignmentProvider(Set<String> connectorTypes) {
for (String connectorType : connectorTypes) {
String path = KeyBuilder.getTargetAssignmentBase(_cluster, connectorType);
_zkclient.subscribeDataChanges(path, this);
Expand Down Expand Up @@ -1956,7 +1956,7 @@ private class ZkStateChangeListener implements IZkStateListener {
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("SessionExpiryScheduler-%d").build());
private Future<?> _zkSessionExpiryFuture = CompletableFuture.completedFuture("completed");

public ZkStateChangeListener() {
ZkStateChangeListener() {
_zkclient.subscribeStateChanges(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Provides a Datastream cluster, including a ZooKeeper cluster and Kafka cluster (if necessary), for testing purposes.
*/
public class EmbeddedDatastreamCluster {
public final class EmbeddedDatastreamCluster {

public static final String CONFIG_ZK_CONNECT = "zookeeper.connect";
public static final String BOOTSTRAP_SERVERS_CONFIG = "bootstrap.servers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
/**
* Utility class for writing tests that deal with Datastream objects.
*/
public class DatastreamTestUtils {
public final class DatastreamTestUtils {

private DatastreamTestUtils() {
}

/**
* Creates variable number of Datastreams from a list of names with
* fields populated with default values except for name and connector type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* Test utilities for verifying metrics
* @see MetricsAware
*/
public class MetricsTestUtils {
public final class MetricsTestUtils {
// Mapping of BrooklinMetricInfo sub-types -> com.codahale.metrics types
private static final Map<Class<? extends BrooklinMetricInfo>, Class<? extends Metric>> METRICS_TYPE_MAPPING = ImmutableMap.of(
BrooklinCounterInfo.class, Counter.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* The main class containing the entry point of the Datastream REST client command line utility
*/
public class DatastreamRestClientCli {
public final class DatastreamRestClientCli {

private DatastreamRestClientCli() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
/**
* String constants for options used with {@link DatastreamRestClientCli}
*/
public class OptionConstants {
public final class OptionConstants {

private OptionConstants() {
}

public static final String OPT_SHORT_MGMT_URI = "u";
public static final String OPT_LONG_MGMT_URI = "uri";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
/**
* Utility class for creating command line {@link Option}s
*/
public class OptionUtils {
public final class OptionUtils {

private OptionUtils() {
}

/**
* Create a command line option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
/**
* Utility methods for encoding/decoding data into/from Avro.
*/
public class AvroUtils {
public final class AvroUtils {

private AvroUtils() {
}

/**
* Encode an Avro record into byte array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
/**
* Class that contains the helper utility methods for File system operations.
*/
public class FileUtils {
public final class FileUtils {

private FileUtils() {
}

private static final Logger LOG = LoggerFactory.getLogger(FileUtils.class.getName());

Expand Down
Loading
Loading