Skip to content

Commit

Permalink
chore: change packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sauljabin committed Jan 31, 2024
1 parent 617ba99 commit 7079a70
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.littlehorse.canary.app;
package io.littlehorse.canary;

import io.littlehorse.canary.config.CanaryConfig;

Expand Down
17 changes: 17 additions & 0 deletions canary/src/main/java/io/littlehorse/canary/CanaryException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.littlehorse.canary;

public class CanaryException extends RuntimeException {
public CanaryException() {}

public CanaryException(String message) {
super(message);
}

public CanaryException(String message, Throwable cause) {
super(message, cause);
}

public CanaryException(Throwable cause) {
super(cause);
}
}
1 change: 0 additions & 1 deletion canary/src/main/java/io/littlehorse/canary/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.Lists;
import io.littlehorse.canary.aggregator.AggregatorBootstrap;
import io.littlehorse.canary.app.Bootstrap;
import io.littlehorse.canary.config.CanaryConfig;
import io.littlehorse.canary.config.ConfigLoader;
import io.littlehorse.canary.kafka.KafkaBootstrap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.littlehorse.canary.aggregator;

import com.google.protobuf.InvalidProtocolBufferException;
import io.littlehorse.canary.app.Bootstrap;
import io.littlehorse.canary.Bootstrap;
import io.littlehorse.canary.config.CanaryConfig;
import io.littlehorse.canary.proto.Metric;
import io.littlehorse.canary.proto.StreamTopologyFailure;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.littlehorse.canary.kafka;

import io.littlehorse.canary.app.Bootstrap;
import io.littlehorse.canary.app.InitializationException;
import io.littlehorse.canary.Bootstrap;
import io.littlehorse.canary.CanaryException;
import io.littlehorse.canary.config.CanaryConfig;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -29,7 +29,7 @@ public void initialize(CanaryConfig config) {
if (e.getCause() instanceof TopicExistsException) {
log.warn(e.getMessage());
} else {
throw new InitializationException(e);
throw new CanaryException(e);
}
}
log.trace("Initialized");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.littlehorse.canary.kafka;

import io.littlehorse.canary.CanaryException;
import io.littlehorse.canary.config.CanaryConfig;
import io.littlehorse.canary.proto.Metric;
import java.io.Closeable;
Expand Down Expand Up @@ -40,7 +41,7 @@ public RecordMetadata emit(String key, Metric metric) {
try {
return future(key, metric).get();
} catch (InterruptedException | ExecutionException e) {
throw new MetricsEmitterException(e);
throw new CanaryException(e);
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.littlehorse.canary.metronome;

import io.littlehorse.canary.app.Bootstrap;
import io.littlehorse.canary.Bootstrap;
import io.littlehorse.canary.config.CanaryConfig;

public class MetronomeBootstrap implements Bootstrap {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.littlehorse.canary.metronome;

import io.littlehorse.canary.app.Bootstrap;
import io.littlehorse.canary.app.InitializationException;
import io.littlehorse.canary.Bootstrap;
import io.littlehorse.canary.CanaryException;
import io.littlehorse.canary.config.CanaryConfig;
import io.littlehorse.canary.kafka.MetricsEmitter;
import io.littlehorse.sdk.common.config.LHConfig;
Expand All @@ -25,7 +25,7 @@ private void initializeWorkflow(LHConfig lhConfig) {
try {
workflow.registerWfSpec(lhConfig.getBlockingStub());
} catch (IOException e) {
throw new InitializationException(e);
throw new CanaryException(e);
}
}

Expand All @@ -36,7 +36,7 @@ private void initializeTaskWorker(LHConfig lhConfig, CanaryConfig config) {
worker.registerTaskDef();
worker.start();
} catch (IOException e) {
throw new InitializationException(e);
throw new CanaryException(e);
}
}

Expand Down

0 comments on commit 7079a70

Please sign in to comment.