public void Initialize(long managedDriverId, FrameworkInfo frameworkInfo, string masterAddress, bool implicitAcknowledgements, Credential credential) { var schedulerInterface = SchedulerCallbacks.GetSchedulerInterface(); var frameworkInfoBytes = ProtoBufHelper.Serialize(frameworkInfo); byte[] credentialBytes = null; if (credential != null) { credentialBytes = ProtoBufHelper.Serialize(credential); } unsafe { using (var pinnedFrameworkInfo = MarshalHelper.CreatePinnedObject(frameworkInfoBytes)) using (var pinnedCredential = MarshalHelper.CreatePinnedObject(credentialBytes)) _nativeDriverPtr = NativeImports.SchedulerDriver.Initialize(managedDriverId, &schedulerInterface, pinnedFrameworkInfo.Ptr, masterAddress, implicitAcknowledgements, pinnedCredential.Ptr); } }
public Status SendFrameworkMessage(byte[] data) { using (var pinned = MarshalHelper.CreatePinnedObject(data)) return((Status)NativeImports.ExecutorDriver.SendFrameworkMessage(_nativeDriverPtr, pinned.Ptr)); }
private static void FrameworkMessage(long managedDriverId, NativeArray *data) { CallExecutor(managedDriverId, (driver, executor) => executor.FrameworkMessage(driver, MarshalHelper.ToMangedByteArray(data))); }