@Test void split() { final Mapper mapper = new PartitionMapperImpl("Root", "Test", null, "Plugin", false, new SampleMapper()); assertEquals(10, mapper.assess()); final List<Mapper> split = mapper.split(3); assertEquals(3, split.stream().distinct().count()); split.forEach(s -> { assertTrue(PartitionMapperImpl.class.isInstance(s)); assertNotSame(mapper, s); assertInput(s); }); }
@Override public List<Mapper> split(final long desiredSize) { lazyInit(); return ((Collection<?>) doInvoke(split, splitArgSupplier.apply(desiredSize))) .stream() .map(Serializable.class::cast) .map(mapper -> new PartitionMapperImpl(rootName(), name(), inputName, plugin(), stream, mapper)) .collect(toList()); }
PartitionMapperImpl extends LifecycleImpl implements Mapper, Delegated { @Override public List<Mapper> split(final long desiredSize) { lazyInit(); return ((Collection<?>) doInvoke(split, splitArgSupplier.apply(desiredSize))) .stream() .map(Serializable.class::cast) .map(mapper -> new PartitionMapperImpl(rootName(), name(), inputName, plugin(), stream, mapper)) .collect(toList()); } }
PartitionMapperImpl extends LifecycleImpl implements Mapper, Delegated { @Override public List<Mapper> split(final long desiredSize) { lazyInit(); return ((Collection<?>) doInvoke(split, splitArgSupplier.apply(desiredSize))) .stream() .map(Serializable.class::cast) .map(mapper -> new PartitionMapperImpl(rootName(), name(), inputName, plugin(), stream, mapper)) .collect(toList()); } PartitionMapperImpl(final String rootName, final String name, final String inputName, final String plugin,
            final boolean stream, final Serializable instance); protected  PartitionMapperImpl(); }
PartitionMapperImpl extends LifecycleImpl implements Mapper, Delegated { @Override public List<Mapper> split(final long desiredSize) { lazyInit(); return ((Collection<?>) doInvoke(split, splitArgSupplier.apply(desiredSize))) .stream() .map(Serializable.class::cast) .map(mapper -> new PartitionMapperImpl(rootName(), name(), inputName, plugin(), stream, mapper)) .collect(toList()); } PartitionMapperImpl(final String rootName, final String name, final String inputName, final String plugin,
            final boolean stream, final Serializable instance); protected  PartitionMapperImpl(); @Override long assess(); @Override List<Mapper> split(final long desiredSize); @Override Input create(); @Override boolean isStream(); @Override Object getDelegate(); }
PartitionMapperImpl extends LifecycleImpl implements Mapper, Delegated { @Override public List<Mapper> split(final long desiredSize) { lazyInit(); return ((Collection<?>) doInvoke(split, splitArgSupplier.apply(desiredSize))) .stream() .map(Serializable.class::cast) .map(mapper -> new PartitionMapperImpl(rootName(), name(), inputName, plugin(), stream, mapper)) .collect(toList()); } PartitionMapperImpl(final String rootName, final String name, final String inputName, final String plugin,
            final boolean stream, final Serializable instance); protected  PartitionMapperImpl(); @Override long assess(); @Override List<Mapper> split(final long desiredSize); @Override Input create(); @Override boolean isStream(); @Override Object getDelegate();  }