Package com.basho.riak.client.query.functions

Examples of com.basho.riak.client.query.functions.NamedJSFunction


        if(nf instanceof NamedErlangFunction) {
            NamedErlangFunction nef = (NamedErlangFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_MOD, nef.getMod());
            jg.writeStringField(Constants.FL_SCHEMA_FUN_FUN, nef.getFun());
        } else {
            NamedJSFunction njsf = (NamedJSFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_NAME, njsf.getFunction());
        }
        jg.writeEndObject();
    }
View Full Code Here


                    name = jp.getText();
                }
                token = jp.nextToken();
            }
            if (name != null) {
                return new NamedJSFunction(name);
            } else {
                return null;
            }
        }
        throw ctxt.mappingException(NamedJSFunction.class);
View Full Code Here

        if(nf instanceof NamedErlangFunction) {
            NamedErlangFunction nef = (NamedErlangFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_MOD, nef.getMod());
            jg.writeStringField(Constants.FL_SCHEMA_FUN_FUN, nef.getFun());
        } else {
            NamedJSFunction njsf = (NamedJSFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_NAME, njsf.getFunction());
        }
        jg.writeEndObject();
    }
View Full Code Here

        try {
            MapReduceResult result = riakClient.mapReduce("Triggered_Alert;" + accountName)
                    .addKeyFilter(new TokenizeFilter(";",2))
                    .addKeyFilter(new StringToIntFilter())
                    .addKeyFilter(new BetweenFilter(fromTimeperiod, toTimeperiod))
                    .addMapPhase(new NamedJSFunction("Riak.mapValuesJson"), true)
                    .execute();

            logger.info("Key Filter: " + result.getResultRaw().toString());

            Collection<BasicTriggeredAlert> rtaList = result.getResult(BasicTriggeredAlert.class);
View Full Code Here

        try {
            MapReduceResult result = riakClient.mapReduce("Triggered_Alert;" + accountName)
                    .addKeyFilter(new TokenizeFilter(";",2))
                    .addKeyFilter(new StringToIntFilter())
                    .addKeyFilter(new BetweenFilter(fromTimeperiod, toTimeperiod))
                    .addMapPhase(new NamedJSFunction("Riak.mapValuesJson"), true)
                    .execute();

            logger.info("Key Filter: " + result.getResultRaw().toString());

            Collection<BasicTriggeredAlert> rtaList = result.getResult(BasicTriggeredAlert.class);
View Full Code Here

                    name = jp.getText();
                }
                token = jp.nextToken();
            }
            if (name != null) {
                return new NamedJSFunction(name);
            } else {
                return null;
            }
        }
        throw ctxt.mappingException(NamedJSFunction.class);
View Full Code Here

        if(nf instanceof NamedErlangFunction) {
            NamedErlangFunction nef = (NamedErlangFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_MOD, nef.getMod());
            jg.writeStringField(Constants.FL_SCHEMA_FUN_FUN, nef.getFun());
        } else {
            NamedJSFunction njsf = (NamedJSFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_NAME, njsf.getFunction());
        }
        jg.writeEndObject();
    }
View Full Code Here

        if(nf instanceof NamedErlangFunction) {
            NamedErlangFunction nef = (NamedErlangFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_MOD, nef.getMod());
            jg.writeStringField(Constants.FL_SCHEMA_FUN_FUN, nef.getFun());
        } else {
            NamedJSFunction njsf = (NamedJSFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_NAME, njsf.getFunction());
        }
        jg.writeEndObject();
    }
View Full Code Here

            .notFoundOK(properties.getNotFoundOk())
            .search(properties.getSearchEnabled());
       
            for (CommitHook hook : properties.getPrecommitHooks()) {
                if (hook.isJavascript()) {
                    builder.addPrecommitHook(new NamedJSFunction(hook.getJsName()));
                } else {
                    builder.addPrecommitHook(new NamedErlangFunction(hook.getErlModule(),
                                                                     hook.getErlFunction()));
                }
            }
View Full Code Here

        if(nf instanceof NamedErlangFunction) {
            NamedErlangFunction nef = (NamedErlangFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_MOD, nef.getMod());
            jg.writeStringField(Constants.FL_SCHEMA_FUN_FUN, nef.getFun());
        } else {
            NamedJSFunction njsf = (NamedJSFunction)nf;
            jg.writeStringField(Constants.FL_SCHEMA_FUN_NAME, njsf.getFunction());
        }
        jg.writeEndObject();
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.query.functions.NamedJSFunction

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.