Skip to content

Commit

Permalink
Allow removal of single beam from processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
acabezas committed May 30, 2019
1 parent ec853f1 commit db1f6f5
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 22 deletions.
69 changes: 57 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>Photon - An Event Sourcing Framework</description>

<packaging>jar</packaging>
<version>0.1.0</version>
<version>0.1.1-SNAPSHOT</version>

<licenses>
<license>
Expand All @@ -34,17 +34,6 @@
</developer>
</developers>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<release.pluginVersion>2.5.2</release.pluginVersion>
<pedantic.enforcers>MODULE_ORDER,DEPENDENCY_CONFIGURATION,DEPENDENCY_SCOPE,PLUGIN_CONFIGURATION</pedantic.enforcers>
Expand All @@ -70,6 +59,9 @@
<java.version>11</java.version>
<java.source.version>1.8</java.source.version>
<java.target.version>1.8</java.target.version>

<!-- OSSRH -->
<nexusStaging.pluginVersion>1.6.8</nexusStaging.pluginVersion>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -252,6 +244,8 @@
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>signed</releaseProfiles>
<!-- to ensure we only deploy during release:perform -->
<goals>deploy</goals>
<!-- to ensure that tags are of the right format -->
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
Expand Down Expand Up @@ -354,4 +348,55 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- We create a profile here for two things: -->
<!-- 1. centrally specify the deploy to ossrh -->
<!-- 2. Sign all relevant artifacts (via configured GPG keys) -->
<!-- TODO: Automate Release Process #106 -->
<id>signed</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexusStaging.pluginVersion}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
public interface BasePhotonConsumer extends Startable {

/**
* Method to remove a particular reader from the scheduler.
* Method to remove a particular beam for a specific reader from the scheduler.
*
* @param clientName - The name assigned to the reader by the end-user app.
*/
void removeBeamFromProcessing(String clientName);
void removeBeamFromProcessing(String clientName, String beamName);

/**
* Method to configure the polling interval for the scheduler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public void putBeamForAsyncProcessing(String clientName, String beamName, Photon
}

@Override
public void removeBeamFromProcessing(String clientName) {
beamReaderConfigManager.removeBeamReaderConfig(clientName);
public void removeBeamFromProcessing(String clientName, String beamName) {
beamReaderConfigManager.removeBeamReaderConfig(clientName, beamName);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public void putBeamForProcessing(String clientName,
}

@Override
public void removeBeamFromProcessing(String clientName) {
photonConsumer.removeBeamFromProcessing(clientName);
public void removeBeamFromProcessing(String clientName, String beamName) {
photonConsumer.removeBeamFromProcessing(clientName, beamName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
import com.homeaway.datatools.photon.client.consumer.PhotonBeamReaderConfig;

import java.util.Optional;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Consumer;

public interface BeamReaderConfigManager {

void putBeamReaderConfig(PhotonBeamReaderConfig photonBeamReaderConfig);

ConcurrentMap<String, PhotonBeamReaderConfig> removeBeamReaderConfig(String clientName);
PhotonBeamReaderConfig removeBeamReaderConfig(String clientName, String beamName);

Optional<PhotonBeamReaderConfig> getBeamReaderConfig(String clientName, String beamName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void putBeamReaderConfig(PhotonBeamReaderConfig photonBeamReaderConfig) {
}

@Override
public ConcurrentMap<String, PhotonBeamReaderConfig> removeBeamReaderConfig(String clientName) {
return beamConfigs.remove(clientName);
public PhotonBeamReaderConfig removeBeamReaderConfig(String clientName, String beamName) {
return beamConfigs.get(clientName).remove(beamName);
}

@Override
Expand Down

0 comments on commit db1f6f5

Please sign in to comment.