Examples of RotationStrategy


Examples of org.graylog2.plugin.indexer.rotation.RotationStrategy

    protected Logger getLogger() {
        return LOG;
    }

    protected void checkForRotation() {
        final RotationStrategy rotationStrategy = rotationStrategyProvider.get();

        String currentTarget;
        try {
            currentTarget = deflector.getNewestTargetName();
        } catch (NoTargetIndexException e) {
            LOG.error("Could not find current deflector target. Aborting.", e);
            return;
        }
        final RotationStrategy.Result rotate = rotationStrategy.shouldRotate(currentTarget);
        if (rotate == null) {
            LOG.error("Cannot perform rotation at this moment.");
            return;
        }
        LOG.debug("Rotation strategy result: {}", rotate.getDescription());
View Full Code Here

Examples of org.graylog2.plugin.indexer.rotation.RotationStrategy

        rotationStrategy = configuration.getRotationStrategy();
    }

    @Override
    public RotationStrategy get() {
        final RotationStrategy strategy = strategies.get(rotationStrategy);
        if (strategy == null) {
            return strategies.get("count"); // TODO how can we do this in a more flexible way?
        }
        return strategy;
    }
View Full Code Here

Examples of org.graylog2.plugin.indexer.rotation.RotationStrategy

    @Test
    public void testFailedRotation() {
        final Provider<RotationStrategy> provider = new Provider<RotationStrategy>() {
            @Override
            public RotationStrategy get() {
                return new RotationStrategy() {
                    @Nullable
                    @Override
                    public Result shouldRotate(String index) {
                        return null;
                    }
View Full Code Here

Examples of org.graylog2.plugin.indexer.rotation.RotationStrategy

    @Test
    public void testPerformRotation() throws NoTargetIndexException {
        final Provider<RotationStrategy> provider = new Provider<RotationStrategy>() {
            @Override
            public RotationStrategy get() {
                return new RotationStrategy() {
                    @Nullable
                    @Override
                    public Result shouldRotate(String index) {
                        return new Result() {
                            @Override
View Full Code Here

Examples of org.graylog2.plugin.indexer.rotation.RotationStrategy

    @Test
    public void testDontPerformRotation() throws NoTargetIndexException {
        final Provider<RotationStrategy> provider = new Provider<RotationStrategy>() {
            @Override
            public RotationStrategy get() {
                return new RotationStrategy() {
                    @Nullable
                    @Override
                    public Result shouldRotate(String index) {
                        return new Result() {
                            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.