@POST
    @Path("/")
    @Produces({ "text/plain" })
    public void mapReduce(@QueryParam("params") String params, @QueryParam("jobName") String jobName,
            @QueryParam("inputKeyspace") String inputKeyspace,
            @QueryParam("inputColumnFamily") String inputColumnFamily,
            @QueryParam("outputKeyspace") String outputKeyspace,
            @QueryParam("outputColumnFamily") String outputColumnFamily,
            @QueryParam("mapEmitFlag") String mapEmitFlag,
            @QueryParam("reduceRawDataFlag") String reduceRawDataFlag,
            String source) throws Throwable {
        if (inputKeyspace == null)
            throw new RuntimeException("Must supply inputKeyspace.");
        if (inputColumnFamily == null)
            throw new RuntimeException("Must supply inputColumnFamily.");
        if (outputKeyspace == null)
            throw new RuntimeException("Must supply outputKeyspace.");
        if (outputColumnFamily == null)
            throw new RuntimeException("Must supply outputColumnFamily.");

        
        if (logger.isDebugEnabled()) {
            logger.debug("Launching job [" + jobName + "]");
            logger.debug("  --> Input  : Keyspace [" + inputKeyspace + "], ColumnFamily [" + inputColumnFamily + "]");
            logger.debug("  <-- Output : Keyspace [" + outputKeyspace + "], ColumnFamily [" + outputColumnFamily + "]");
        }

        if (VirgilConfiguration.isEmbedded()) {
            logger.debug("Running in embedded mode.");
            JobSpawner.spawnLocal(jobName, VirgilConfiguration.getHost(), VirgilConfiguration.getPort(), inputKeyspace,
                    inputColumnFamily, outputKeyspace, outputColumnFamily, source, params, mapEmitFlag, reduceRawDataFlag);
        } else {
            logger.debug("Spawning job remotely.");
            JobSpawner.spawnRemote(jobName, VirgilConfiguration.getHost(), VirgilConfiguration.getPort(),
                    inputKeyspace, inputColumnFamily, outputKeyspace, outputColumnFamily, source, params, mapEmitFlag, reduceRawDataFlag);
        }
    }
@ POST @ Path ( "/" ) @ Produces ( { "text/plain" } ) public void mapReduce ( @ QueryParam ( "params" ) String params , @ QueryParam ( "jobName" ) String jobName , @ QueryParam ( "inputKeyspace" ) String inputKeyspace , @ QueryParam ( "inputColumnFamily" ) String inputColumnFamily , @ QueryParam ( "outputKeyspace" ) String outputKeyspace , @ QueryParam ( "outputColumnFamily" ) String outputColumnFamily , @ QueryParam ( "mapEmitFlag" ) String mapEmitFlag , @ QueryParam ( "reduceRawDataFlag" ) String reduceRawDataFlag , String source ) throws Throwable { if ( inputKeyspace == null ) throw new RuntimeException ( "Must supply inputKeyspace." ) ; if ( inputColumnFamily == null ) throw new RuntimeException ( "Must supply inputColumnFamily." ) ; if ( outputKeyspace == null ) throw new RuntimeException ( "Must supply outputKeyspace." ) ; if ( outputColumnFamily == null ) throw new RuntimeException ( "Must supply outputColumnFamily." ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Launching job [" + jobName + "]" ) ; logger . debug ( "  --> Input  : Keyspace [" + inputKeyspace + "], ColumnFamily [" + inputColumnFamily + "]" ) ; logger . debug ( "  <-- Output : Keyspace [" + outputKeyspace + "], ColumnFamily [" + outputColumnFamily + "]" ) ; } if ( VirgilConfiguration . isEmbedded ( ) ) { logger . debug ( "Running in embedded mode." ) ; JobSpawner . spawnLocal ( jobName , VirgilConfiguration . getHost ( ) , VirgilConfiguration . getPort ( ) , inputKeyspace , inputColumnFamily , outputKeyspace , outputColumnFamily , source , params , mapEmitFlag , reduceRawDataFlag ) ; } else { logger . debug ( "Spawning job remotely." ) ; JobSpawner . spawnRemote ( jobName , VirgilConfiguration . getHost ( ) , VirgilConfiguration . getPort ( ) , inputKeyspace , inputColumnFamily , outputKeyspace , outputColumnFamily , source , params , mapEmitFlag , reduceRawDataFlag ) ; } }
================================================================================================================