문제

I am unable to compile MapReduceSpecification.of .It does work when i select //new DatastoreOutput(1)), but incase of new GoogleCloudStorageFileOutput("images.sb.a-cti.com/staging/test", "result.txt", "text/plain", 1)), . This show compile error not sure if i am missing something .

I have tried replacing with different Marshallers but the result was same .

Could some one put some light on this.

 @RequestMapping("/accountJDOCounter")
 public void accountJDOCounter(HttpServletRequest request, HttpServletResponse   response){


  try{
    String entityClassName = request.getParameter("entityClassName");

    String entityKind = request.getParameter("entityKind");


   if(entityKind == null){

       response.getWriter().write("Error");

       return;

     }

    MapReduceSettings settings = new       MapReduceSettings().setWorkerQueueName("default").setControllerQueueName("default").setBuck        etName("images.sb.a-cti.com/staging/test");


   logger.info("Creating job15");


   String jobId = MapReduceJob.start(

   MapReduceSpecification.of(

     "AccountJDO",

  new DatastoreInput(entityKind, 10),

  new AccountCounterMapper(),

  Marshallers.getStringMarshaller(),

  Marshallers.getLongMarshaller(),

  new AccountCounterReducer(),

 //new InMemoryOutput<KeyValue<String, Long>>(2)),

  new GoogleCloudStorageFileOutput("images.sb.a-cti.com/staging/test", "result.txt", "text/plain", 1)),

   //new DatastoreOutput(1)),

  settings);

 // jobId is used to monitor, see step 5) below


 response.getWriter().write("jobId " + jobId);


 logger.info("JobId " + jobId);


 }catch(Exception e){

 StringWriter sw = new StringWriter();

 PrintWriter pw = new PrintWriter(sw);

e.printStackTrace(pw);

 logger.info("Error " + sw.toString());

  }


 }

Error detail: Multiple markers at this line

  • The method of(String, Input, Mapper, Marshaller, Marshaller, Reducer, Output) in the type MapReduceSpecification is not

applicable for the arguments (String, DatastoreInput, AccountCounterMapper, Marshaller, Marshaller, AccountCounterReducer,

InMemoryOutput>)

  • The method of(String, Input, Mapper, Marshaller, Marshaller, Reducer, Output) in the type MapReduceSpecification is not

applicable for the arguments (String, DatastoreInput, AccountCounterMapper, Marshaller, Marshaller, AccountCounterReducer,

GoogleCloudStorageFileOutput)

Thanks in advance.

도움이 되었습니까?

해결책

The generics in the signature need to match. A GoogleCloudStorageFileOutput takes a ByteBuffer while a DatastoreOutput takes an Entity. So depending on what type is emitted by AccountCounterReducer, you'll need to select an output that matches that type.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top