Java 类com.lmax.disruptor.EventTranslatorVararg 实例源码

项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
private void translateAndPublishBatch(final EventTranslatorVararg<E> translator, int batchStartsAt,
                                      final int batchSize, final long finalSequence, final Object[][] args)
{
    final long initialSequence = finalSequence - (batchSize - 1);
    try
    {
        long sequence = initialSequence;
        final int batchEndsAt = batchStartsAt + batchSize;
        for (int i = batchStartsAt; i < batchEndsAt; i++)
        {
            translator.translateTo(get(sequence), sequence++, args[i]);
        }
    }
    finally
    {
        sequencer.publish(initialSequence, finalSequence);
    }
}
项目:learn_jstorm    文件:RingBuffer.java   
private void translateAndPublishBatch(final EventTranslatorVararg<E> translator, int batchStartsAt,
                                      final int batchSize, final long finalSequence, final Object[][] args)
{
    final long initialSequence = finalSequence - (batchSize - 1);
    try
    {
        long sequence = initialSequence;
        final int batchEndsAt = batchStartsAt + batchSize;
        for (int i = batchStartsAt; i < batchEndsAt; i++)
        {
            translator.translateTo(get(sequence), sequence++, args[i]);
        }
    }
    finally
    {
        sequencer.publish(initialSequence, finalSequence);
    }
}
项目:Tstream    文件:RingBuffer.java   
private void translateAndPublishBatch(final EventTranslatorVararg<E> translator, int batchStartsAt,
                                      final int batchSize, final long finalSequence, final Object[][] args)
{
    final long initialSequence = finalSequence - (batchSize - 1);
    try
    {
        long sequence = initialSequence;
        final int batchEndsAt = batchStartsAt + batchSize;
        for (int i = batchStartsAt; i < batchEndsAt; i++)
        {
            translator.translateTo(get(sequence), sequence++, args[i]);
        }
    }
    finally
    {
        sequencer.publish(initialSequence, finalSequence);
    }
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 * @return true if the value was published, false if there was insufficient
 * capacity.
 */
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    try
    {
        final long sequence = sequencer.tryNext();
        translateAndPublish(translator, sequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch.
 * @param args          User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient
 *         capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(args, batchStartsAt, batchSize);
    try
    {
        final long finalSequence = sequencer.tryNext(batchSize);
        translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
private void translateAndPublish(EventTranslatorVararg<E> translator, long sequence, Object...args)
{
    try
    {
        translator.translateTo(get(sequence), sequence, args);
    }
    finally
    {
        sequencer.publish(sequence);
    }
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 * @return true if the value was published, false if there was insufficient
 * capacity.
 */
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    try
    {
        final long sequence = sequencer.tryNext();
        translateAndPublish(translator, sequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch.
 * @param args          User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient
 *         capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(args, batchStartsAt, batchSize);
    try
    {
        final long finalSequence = sequencer.tryNext(batchSize);
        translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:learn_jstorm    文件:RingBuffer.java   
private void translateAndPublish(EventTranslatorVararg<E> translator, long sequence, Object...args)
{
    try
    {
        translator.translateTo(get(sequence), sequence, args);
    }
    finally
    {
        sequencer.publish(sequence);
    }
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 * 
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 * @return true if the value was published, false if there was insufficient capacity.
 */
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
    try {
        final long sequence = sequencer.tryNext();
        translateAndPublish(translator, sequence, args);
        return true;
    } catch (InsufficientCapacityException e) {
        return false;
    }
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 * 
 * @param translator The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize The actual size of the batch.
 * @param args User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) {
    checkBounds(args, batchStartsAt, batchSize);
    try {
        final long finalSequence = sequencer.tryNext(batchSize);
        translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
        return true;
    } catch (InsufficientCapacityException e) {
        return false;
    }
}
项目:jstrom    文件:RingBuffer.java   
private void translateAndPublish(EventTranslatorVararg<E> translator, long sequence, Object... args) {
    try {
        translator.translateTo(get(sequence), sequence, args);
    } finally {
        sequencer.publish(sequence);
    }
}
项目:jstrom    文件:RingBuffer.java   
private void translateAndPublishBatch(final EventTranslatorVararg<E> translator, int batchStartsAt, final int batchSize, final long finalSequence,
        final Object[][] args) {
    final long initialSequence = finalSequence - (batchSize - 1);
    try {
        long sequence = initialSequence;
        final int batchEndsAt = batchStartsAt + batchSize;
        for (int i = batchStartsAt; i < batchEndsAt; i++) {
            translator.translateTo(get(sequence), sequence++, args[i]);
        }
    } finally {
        sequencer.publish(initialSequence, finalSequence);
    }
}
项目:Tstream    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 * @return true if the value was published, false if there was insufficient
 * capacity.
 */
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    try
    {
        final long sequence = sequencer.tryNext();
        translateAndPublish(translator, sequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:Tstream    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch.
 * @param args          User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient
 *         capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(args, batchStartsAt, batchSize);
    try
    {
        final long finalSequence = sequencer.tryNext(batchSize);
        translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
        return true;
    }
    catch (InsufficientCapacityException e)
    {
        return false;
    }
}
项目:Tstream    文件:RingBuffer.java   
private void translateAndPublish(EventTranslatorVararg<E> translator, long sequence, Object...args)
{
    try
    {
        translator.translateTo(get(sequence), sequence, args);
    }
    finally
    {
        sequencer.publish(sequence);
    }
}
项目:jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 * 
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 * @return true if the value was published, false if there was insufficient capacity.
 */
public boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args) {
    try {
        final long sequence = sequencer.tryNext();
        translateAndPublish(translator, sequence, args);
        return true;
    } catch (InsufficientCapacityException e) {
        return false;
    }
}
项目:jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 * 
 * @param translator The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize The actual size of the batch.
 * @param args User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) {
    checkBounds(args, batchStartsAt, batchSize);
    try {
        final long finalSequence = sequencer.tryNext(batchSize);
        translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
        return true;
    } catch (InsufficientCapacityException e) {
        return false;
    }
}
项目:jstorm    文件:RingBuffer.java   
private void translateAndPublish(EventTranslatorVararg<E> translator, long sequence, Object... args) {
    try {
        translator.translateTo(get(sequence), sequence, args);
    } finally {
        sequencer.publish(sequence);
    }
}
项目:jstorm    文件:RingBuffer.java   
private void translateAndPublishBatch(final EventTranslatorVararg<E> translator, int batchStartsAt, final int batchSize, final long finalSequence,
        final Object[][] args) {
    final long initialSequence = finalSequence - (batchSize - 1);
    try {
        long sequence = initialSequence;
        final int batchEndsAt = batchStartsAt + batchSize;
        for (int i = batchStartsAt; i < batchEndsAt; i++) {
            translator.translateTo(get(sequence), sequence++, args[i]);
        }
    } finally {
        sequencer.publish(initialSequence, finalSequence);
    }
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public void publishEvent(EventTranslatorVararg<ResponseEvent> translator, Object... args) {
    throw new UnsupportedOperationException();
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public boolean tryPublishEvent(EventTranslatorVararg<ResponseEvent> translator, Object... args) {
    throw new UnsupportedOperationException();
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public void publishEvents(EventTranslatorVararg<ResponseEvent> translator, Object[]... args) {
    throw new UnsupportedOperationException();
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public void publishEvents(EventTranslatorVararg<ResponseEvent> translator, int batchStartsAt, int batchSize, Object[]... args) {
    throw new UnsupportedOperationException();
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public boolean tryPublishEvents(EventTranslatorVararg<ResponseEvent> translator, Object[]... args) {
    throw new UnsupportedOperationException();
}
项目:couchbase-jvm-core    文件:CollectingResponseEventSink.java   
@Override
public boolean tryPublishEvents(EventTranslatorVararg<ResponseEvent> translator, int batchStartsAt, int batchSize, Object[]... args) {
    throw new UnsupportedOperationException();
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch
 * @param args          User supplied arguments, one Object[] per event.
 * @see #publishEvents(EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(batchStartsAt, batchSize, args);
    final long finalSequence = sequencer.next(batchSize);
    translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch
 * @param args          User supplied arguments, one Object[] per event.
 * @see #publishEvents(EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(batchStartsAt, batchSize, args);
    final long finalSequence = sequencer.next(batchSize);
    translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
}
项目:Tstream    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator    The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize     The actual size of the batch
 * @param args          User supplied arguments, one Object[] per event.
 * @see #publishEvents(EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args)
{
    checkBounds(batchStartsAt, batchSize, args);
    final long finalSequence = sequencer.next(batchSize);
    translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 */
public void publishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    final long sequence = sequencer.next();
    translateAndPublish(translator, sequence, args);
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator The user specified translation for the event
 * @param args       User supplied arguments, one Object[] per event.
 * @see #publishEvents(com.lmax.disruptor.EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, Object[]... args)
{
    publishEvents(translator, 0, args.length, args);
}
项目:jstorm-0.9.6.3-    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator The user specified translation for the event
 * @param args       User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient
 *         capacity.
 * @see #publishEvents(com.lmax.disruptor.EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args)
{
    return tryPublishEvents(translator, 0, args.length, args);
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 */
public void publishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    final long sequence = sequencer.next();
    translateAndPublish(translator, sequence, args);
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator The user specified translation for the event
 * @param args       User supplied arguments, one Object[] per event.
 * @see #publishEvents(com.lmax.disruptor.EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, Object[]... args)
{
    publishEvents(translator, 0, args.length, args);
}
项目:learn_jstorm    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 *
 * @param translator The user specified translation for the event
 * @param args       User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient
 *         capacity.
 * @see #publishEvents(com.lmax.disruptor.EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args)
{
    return tryPublishEvents(translator, 0, args.length, args);
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 * 
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 */
public void publishEvent(EventTranslatorVararg<E> translator, Object... args) {
    final long sequence = sequencer.next();
    translateAndPublish(translator, sequence, args);
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 * 
 * @param translator The user specified translation for the event
 * @param args User supplied arguments, one Object[] per event.
 * @see #publishEvents(EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, Object[]... args) {
    publishEvents(translator, 0, args.length, args);
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 * 
 * @param translator The user specified translation for the event
 * @param batchStartsAt The first element of the array which is within the batch.
 * @param batchSize The actual size of the batch
 * @param args User supplied arguments, one Object[] per event.
 * @see #publishEvents(EventTranslator[])
 */
public void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) {
    checkBounds(batchStartsAt, batchSize, args);
    final long finalSequence = sequencer.next(batchSize);
    translateAndPublishBatch(translator, batchStartsAt, batchSize, finalSequence, args);
}
项目:jstrom    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments per event.
 * 
 * @param translator The user specified translation for the event
 * @param args User supplied arguments, one Object[] per event.
 * @return true if the value was published, false if there was insufficient capacity.
 * @see #publishEvents(EventTranslator[])
 */
public boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args) {
    return tryPublishEvents(translator, 0, args.length, args);
}
项目:Tstream    文件:RingBuffer.java   
/**
 * Allows a variable number of user supplied arguments
 *
 * @see #publishEvent(EventTranslator)
 * @param translator The user specified translation for the event
 * @param args User supplied arguments.
 */
public void publishEvent(EventTranslatorVararg<E> translator, Object...args)
{
    final long sequence = sequencer.next();
    translateAndPublish(translator, sequence, args);
}