Package io.s4.dispatcher.partitioner

Examples of io.s4.dispatcher.partitioner.KeyInfo


        byte[] v;

        try {
            ClientConnection conn = null;

            ByteArrayIOChannel io = new ByteArrayIOChannel(s);

            v = io.recv();

            if (v == null || v.length == 0) {
                // no information => client initialization
                clientInit(io);
View Full Code Here


    private Map<String, Cloner> clonerMap = new HashMap<String, Cloner>();

    public void processEvent(Object event) {
        Object newEvent = event;
        if (transformers != null && transformers.length > 0) {
            Cloner cloner = clonerMap.get(event.getClass().getName());
            if (cloner == null) {
                ClonerGenerator cg = new ClonerGenerator();
                // generate byte code that knows how to call the clone method on
                // this event
                Class clonerClass = cg.generate(event.getClass());
                try {
                    cloner = (Cloner) clonerClass.newInstance();
                    clonerMap.put(event.getClass().getName(), cloner);
                } catch (InstantiationException ie) {
                    Logger.getLogger(this.getClass()).error(ie);
                    throw new RuntimeException(ie);
                } catch (IllegalAccessException ias) {
                    Logger.getLogger(this.getClass()).error(ias);
                    throw new RuntimeException(ias);
                }
            }
            newEvent = cloner.clone(event);
        }

        for (Transformer transformer : transformers) {
            newEvent = transformer.transform(newEvent);
            if (newEvent == null) {
View Full Code Here

    public void processEvent(Object event) {
        Object newEvent = event;
        if (transformers != null && transformers.length > 0) {
            Cloner cloner = clonerMap.get(event.getClass().getName());
            if (cloner == null) {
                ClonerGenerator cg = new ClonerGenerator();
                // generate byte code that knows how to call the clone method on
                // this event
                Class clonerClass = cg.generate(event.getClass());
                try {
                    cloner = (Cloner) clonerClass.newInstance();
                    clonerMap.put(event.getClass().getName(), cloner);
                } catch (InstantiationException ie) {
                    Logger.getLogger(this.getClass()).error(ie);
View Full Code Here

    public AbstractWindowingPE() {
    }

    public void init() {
        // this reference will be shared amongst all instances of the pe
        slotUtils = new SlotUtils(slotSize);

        try {
            slotClass = Class.forName(slotClassName);
        } catch (ClassNotFoundException cnfe) {
            throw new RuntimeException(cnfe);
View Full Code Here

            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
       
        PEContainer peContainer = (PEContainer) context.getBean("peContainer");

        Watcher w = (Watcher) context.getBean("watcher");
        w.setConfigFilename(configPath);

       
        // load extension modules
        String[] configFileNames = getModuleConfigFiles(extsHome, prop);
        if (configFileNames.length > 0) {
View Full Code Here

        }

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock s4Clock = (Clock) context.getBean("clock");
        if (s4Clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)s4Clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
View Full Code Here

    static EventClock s4Clock;
    static Persister persister;

    public static void main(String[] args) {
        TestPersisterEventClock testPersisterClock = new TestPersisterEventClock();
        s4Clock = new EventClock();
        s4Clock.updateTime(69990000);
        TimeUpdaterThread timeUpdater = new TimeUpdaterThread(s4Clock);
        Thread timeUpdaterThread = new Thread(timeUpdater);
        timeUpdaterThread.start();
        persister = new HashMapPersister(s4Clock);
View Full Code Here

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock s4Clock = (Clock) context.getBean("clock");
        if (s4Clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)s4Clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
       
        PEContainer peContainer = (PEContainer) context.getBean("peContainer");

        Watcher w = (Watcher) context.getBean("watcher");
View Full Code Here

        while (true) {
            EventWrapper eventWrapper = null;
            try {
                eventWrapper = workQueue.take();
                if (s4Clock instanceof EventClock) {
                    EventClock eventClock = (EventClock) s4Clock;
                    eventClock.update(eventWrapper);
                    // To what time to update the clock
                }
                if (trackByKey) {
                    boolean foundOne = false;
                    for (CompoundKeyInfo compoundKeyInfo : eventWrapper.getCompoundKeys()) {
View Full Code Here

    static WallClock s4Clock;
    static Persister persister;

    public static void main(String[] args) {
        TestPersisterWallClock testPersisterClock = new TestPersisterWallClock();
        s4Clock = new WallClock();
        persister = new HashMapPersister(s4Clock);
        testPersisterClock.testPersister(persister);
        persister = new ConMapPersister(s4Clock);
        testPersisterClock.testPersister(persister);
    }
View Full Code Here

TOP

Related Classes of io.s4.dispatcher.partitioner.KeyInfo

Copyright © 2018 www.massapicom. 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.