public static dsn_task_t FileWrite( dsn_handle_t hFile, byte[] buffer, int count, UInt64 offset, TaskCode callbackCode, Servicelet callbackOwner, AioHandler callback, int hash = 0 ) { int idx = GlobalInterOpLookupTable.Put(callback); dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash); Native.dsn_file_write(hFile, buffer, count, offset, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero); return(task); }
public static dsn_task_t CopyRemoteDirectory( dsn_address_t remote, string source_dir, string dest_dir, bool overwrite, TaskCode callbackCode, Servicelet callbackOwner, AioHandler callback, int hash = 0 ) { int idx = GlobalInterOpLookupTable.Put(callback); dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash); Native.dsn_file_copy_remote_directory(remote, source_dir, dest_dir, overwrite, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero); return(task); }
public static void RpcCallAsync( RpcAddress server, RpcWriteStream requestStream, Servicelet callbackOwner, RpcResponseHandler callback, int replyHash = 0 ) { Logging.dassert(requestStream.IsFlushed(), "RpcWriteStream must be flushed after write in the same thread"); var idx = GlobalInterOpLookupTable.Put(callback); dsn_task_t task = Native.dsn_rpc_create_response_task( requestStream.DangerousGetHandle(), _c_rpc_response_handler_holder, (IntPtr)idx, replyHash ); Native.dsn_rpc_call(server, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero); }
public extern static bool dsn_task_wait_timeout(dsn_task_t task, int timeout_milliseconds);
public extern static bool dsn_task_cancel2(dsn_task_t task, bool wait_until_finished, out bool finished);
public extern static void dsn_task_add_ref(dsn_task_t task);
public static extern void dsn_file_copy_remote_directory(dsn_address_t remote, string source_dir, string dest_dir, bool overwrite, dsn_task_t cb);
public static extern void dsn_rpc_enqueue_response(dsn_task_t rpc_call, dsn_error_t err, dsn_message_t response);
public static extern int dsn_task_error(dsn_task_t task);
public extern static void dsn_file_copy_remote_files(dsn_address_t remote, string source_dir, string[] source_files, string dest_dir, bool overwrite, dsn_task_t cb);
public extern static void dsn_file_copy_remote_directory(dsn_address_t remote, string source_dir, string dest_dir, bool overwrite, dsn_task_t cb, dsn_task_tracker_t tracker);
public extern static void dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb, dsn_task_tracker_t tracker);
public extern static void dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call, dsn_task_tracker_t tracker);
public extern static dsn_error_t dsn_task_error(dsn_task_t task);
public extern static bool dsn_task_cancel(dsn_task_t task, bool wait_until_finished);
public extern static void dsn_task_call(dsn_task_t task, dsn_task_tracker_t tracker, int delay_milliseconds);
public SafeTaskHandle(dsn_task_t nativeHandle) : base(nativeHandle, true) { Native.dsn_task_add_ref(nativeHandle); }
public extern static void dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call);
public extern static void dsn_rpc_enqueue_response(dsn_task_t rpc_call, dsn_error_t err, dsn_message_t response);
public SafeTaskHandle(dsn_task_t nativeHandle, int callback_index) : base(nativeHandle, true) { _callback_index = callback_index; Native.dsn_task_add_ref(nativeHandle); }
public extern static void dsn_file_task_enqueue(dsn_task_t cb_task, dsn_error_t err, size_t size);
public static extern void dsn_file_copy_remote_files(dsn_address_t remote, string source_dir, string[] source_files, string dest_dir, bool overwrite, dsn_task_t cb);
public static extern dsn_message_t dsn_rpc_get_response(dsn_task_t rpc_call); // returned msg must be explicitly msg_release_ref
public static extern void dsn_file_task_enqueue(dsn_task_t cb_task, dsn_error_t err, size_t size);
public static extern void dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
public static extern void dsn_file_read(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
public static extern size_t dsn_file_get_io_size(dsn_task_t cb_task);
public static extern void dsn_task_release_ref(dsn_task_t task);
public extern static void dsn_task_release_ref(dsn_task_t task);
public static extern void dsn_task_add_ref(dsn_task_t task);
public extern static void dsn_task_call(dsn_task_t task, int delay_milliseconds);
public static extern void dsn_task_call(dsn_task_t task, int delay_milliseconds);
public extern static bool dsn_task_wait(dsn_task_t task);
public static extern bool dsn_task_cancel2(dsn_task_t task, bool wait_until_finished, out bool finished);
public static extern bool dsn_task_wait(dsn_task_t task);
public extern static dsn_message_t dsn_rpc_get_response(dsn_task_t rpc_call); // returned msg must be explicitly msg_release_ref
public static extern bool dsn_task_wait_timeout(dsn_task_t task, int timeout_milliseconds);
public extern static void dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
public extern static size_t dsn_file_get_io_size(dsn_task_t cb_task);
public static extern void dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call);
public static extern bool dsn_task_cancel(dsn_task_t task, bool wait_until_finished);