private void probeWrite(int pid, ByteBuffer buff) throws HyracksDataException {
   RunFileWriter pWriter = probeRFWriters[pid];
   if (pWriter == null) {
     FileReference file = ctx.getJobletContext().createManagedWorkspaceFile(rel1Name);
     pWriter = new RunFileWriter(file, ctx.getIOManager());
     pWriter.open();
     probeRFWriters[pid] = pWriter;
   }
   pWriter.nextFrame(buff);
 }
 private void buildWrite(int pid, ByteBuffer buff) throws HyracksDataException {
   RunFileWriter writer = buildRFWriters[pid];
   if (writer == null) {
     FileReference file = ctx.getJobletContext().createManagedWorkspaceFile(rel0Name);
     writer = new RunFileWriter(file, ctx.getIOManager());
     writer.open();
     buildRFWriters[pid] = writer;
   }
   writer.nextFrame(buff);
 }
 public FeedMessageOperatorNodePushable(
     IHyracksTaskContext ctx,
     FeedConnectionId connectionId,
     IFeedMessage feedMessage,
     int partition,
     int nPartitions) {
   this.connectionId = connectionId;
   this.message = feedMessage;
   this.partition = partition;
   IAsterixAppRuntimeContext runtimeCtx =
       (IAsterixAppRuntimeContext)
           ctx.getJobletContext().getApplicationContext().getApplicationObject();
   this.feedManager = runtimeCtx.getFeedManager();
 }
Пример #4
0
 @SuppressWarnings("unchecked")
 public static RecordDescriptor getRecordDescriptorFromKeyValueClasses(
     IHyracksTaskContext ctx, Configuration conf, String className1, String className2)
     throws HyracksException {
   RecordDescriptor recordDescriptor = null;
   try {
     recordDescriptor =
         DatatypeHelper.createKeyValueRecordDescriptor(
             (Class<? extends Writable>) ctx.getJobletContext().loadClass(className1),
             (Class<? extends Writable>) ctx.getJobletContext().loadClass(className2),
             conf);
   } catch (Exception cnfe) {
     throw new HyracksException(cnfe);
   }
   return recordDescriptor;
 }
Пример #5
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 public static RecordDescriptor getRecordDescriptorFromWritableClasses(
     IHyracksTaskContext ctx, Configuration conf, String... classNames) throws HyracksException {
   RecordDescriptor recordDescriptor = null;
   ISerializerDeserializer[] serdes = new ISerializerDeserializer[classNames.length];
   try {
     int i = 0;
     for (String className : classNames) {
       Class<? extends Writable> c =
           (Class<? extends Writable>) ctx.getJobletContext().loadClass(className);
       serdes[i++] = DatatypeHelper.createSerializerDeserializer(c, conf, ctx);
       // System.out.println("thread " + Thread.currentThread().getId() + " after creating serde "
       // + c.getClassLoader());
     }
   } catch (Exception cnfe) {
     throw new HyracksException(cnfe);
   }
   recordDescriptor = new RecordDescriptor(serdes);
   return recordDescriptor;
 }
Пример #6
0
 public static RuntimeContext get(IHyracksTaskContext ctx) {
   return (RuntimeContext) ctx.getJobletContext().getApplicationContext().getApplicationObject();
 }