parent
5c56d41aa2
commit
c4098a23f9
|
|
@ -45,10 +45,10 @@ public class DataCarrier<T> {
|
|||
|
||||
/**
|
||||
* set a new IDataPartitioner.
|
||||
* It will cover the current one or default one.(Default is {@link SimpleRollingPartitioner}
|
||||
* It will cover the current one or default one.(Default is {@link SimpleRollingPartitioner)}
|
||||
*
|
||||
* @param dataPartitioner implementation
|
||||
* @return {@link DataCarrier} instance itself
|
||||
* @param dataPartitioner
|
||||
* @return
|
||||
*/
|
||||
public DataCarrier setPartitioner(IDataPartitioner<T> dataPartitioner) {
|
||||
this.channels.setPartitioner(dataPartitioner);
|
||||
|
|
@ -57,10 +57,9 @@ public class DataCarrier<T> {
|
|||
|
||||
/**
|
||||
* override the strategy at runtime.
|
||||
* Notice, {@link Channels} will override several channels one by one.
|
||||
* Notice, {@link Channels<T>} will override several channels one by one.
|
||||
*
|
||||
* @param strategy {@link BufferStrategy}
|
||||
* @return {@link DataCarrier} instance itself
|
||||
* @param strategy
|
||||
*/
|
||||
public DataCarrier setBufferStrategy(BufferStrategy strategy) {
|
||||
this.channels.setStrategy(strategy);
|
||||
|
|
@ -68,9 +67,9 @@ public class DataCarrier<T> {
|
|||
}
|
||||
|
||||
/**
|
||||
* produce data to buffer, using the given {@link BufferStrategy}.
|
||||
* produce data to buffer, using the givven {@link BufferStrategy}.
|
||||
*
|
||||
* @param data inserted into the channel.
|
||||
* @param data
|
||||
* @return false means produce data failure. The data will not be consumed.
|
||||
*/
|
||||
public boolean produce(T data) {
|
||||
|
|
@ -85,11 +84,10 @@ public class DataCarrier<T> {
|
|||
|
||||
/**
|
||||
* set consumers to this Carrier.
|
||||
* consumer begin to run when {@link DataCarrier<T>{@link #produce(Object)}} begin to work.
|
||||
* consumer begin to run when {@link DataCarrier<T>#produce(T)} begin to work.
|
||||
*
|
||||
* @param consumerClass class of consumer
|
||||
* @param num number of consumer threads
|
||||
* @return {@link DataCarrier} instance itself
|
||||
*/
|
||||
public DataCarrier consume(Class<? extends IConsumer<T>> consumerClass, int num) {
|
||||
if (consumerPool != null) {
|
||||
|
|
@ -102,11 +100,11 @@ public class DataCarrier<T> {
|
|||
|
||||
/**
|
||||
* set consumers to this Carrier.
|
||||
* consumer begin to run when produce begin to work.
|
||||
* consumer begin to run when {@link DataCarrier<T>#produce(T)} begin to work.
|
||||
*
|
||||
* @param consumer single instance of consumer, all consumer threads will all use this instance.
|
||||
* @param num number of consumer threads
|
||||
* @return {@link DataCarrier} instance itself
|
||||
* @return
|
||||
*/
|
||||
public DataCarrier consume(IConsumer<T> consumer, int num) {
|
||||
if (consumerPool != null) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class Channels<T> {
|
|||
* override the strategy at runtime. Notice, this will override several channels one by one. So, when running
|
||||
* setStrategy, each channel may use different BufferStrategy
|
||||
*
|
||||
* @param strategy {@link BufferStrategy}
|
||||
* @param strategy
|
||||
*/
|
||||
public void setStrategy(BufferStrategy strategy) {
|
||||
for (Buffer<T> buffer : bufferChannels) {
|
||||
|
|
@ -77,7 +77,7 @@ public class Channels<T> {
|
|||
/**
|
||||
* get channelSize
|
||||
*
|
||||
* @return channel size
|
||||
* @return
|
||||
*/
|
||||
public int getChannelSize() {
|
||||
return this.bufferChannels.length;
|
||||
|
|
|
|||
20
pom.xml
20
pom.xml
|
|
@ -266,26 +266,6 @@
|
|||
</executions>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<aggregate>true</aggregate>
|
||||
<charset>${project.build.sourceEncoding}</charset>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<docencoding>${project.build.sourceEncoding}</docencoding>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue