未验证 提交 820101a1 编写于 作者: O openharmony_ci 提交者: Gitee

!18971 回调返回值示例代码修改(4.0-beta1)

Merge pull request !18971 from Wangkai/OpenHarmony-4.0-Beta1
...@@ -457,7 +457,7 @@ try { ...@@ -457,7 +457,7 @@ try {
kvStore = store; kvStore = store;
kvStore = null; kvStore = null;
store = null; store = null;
kvManager.closeKVStore('appId', 'storeId', function (err, data) { kvManager.closeKVStore('appId', 'storeId', function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close KVStore.code is ${err.code},message is ${err.message}`); console.error(`Failed to close KVStore.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -568,7 +568,7 @@ try { ...@@ -568,7 +568,7 @@ try {
kvStore = store; kvStore = store;
kvStore = null; kvStore = null;
store = null; store = null;
kvManager.deleteKVStore('appId', 'storeId', function (err, data) { kvManager.deleteKVStore('appId', 'storeId', function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to delete KVStore.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete KVStore.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2128,7 +2128,7 @@ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncC ...@@ -2128,7 +2128,7 @@ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncC
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2182,8 +2182,8 @@ put(key: string, value: Uint8Array | string | number | boolean): Promise<void ...@@ -2182,8 +2182,8 @@ put(key: string, value: Uint8Array | string | number | boolean): Promise<void
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info(`Succeeded in putting.data=${data}`); console.info(`Succeeded in putting data`);
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
}); });
...@@ -2239,7 +2239,7 @@ try { ...@@ -2239,7 +2239,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2311,7 +2311,7 @@ try { ...@@ -2311,7 +2311,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (entries) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => { kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries'); console.info('Succeeded in getting Entries');
...@@ -2372,7 +2372,7 @@ try { ...@@ -2372,7 +2372,7 @@ try {
v8Arr.push(vb1); v8Arr.push(vb1);
v8Arr.push(vb2); v8Arr.push(vb2);
v8Arr.push(vb3); v8Arr.push(vb3);
kvStore.putBatch(v8Arr, async function (err, data) { kvStore.putBatch(v8Arr, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2434,7 +2434,7 @@ try { ...@@ -2434,7 +2434,7 @@ try {
v8Arr.push(vb1); v8Arr.push(vb1);
v8Arr.push(vb2); v8Arr.push(vb2);
v8Arr.push(vb3); v8Arr.push(vb3);
kvStore.putBatch(v8Arr).then(async (data) => { kvStore.putBatch(v8Arr).then(async () => {
console.info(`Succeeded in putting patch`); console.info(`Succeeded in putting patch`);
}).catch((err) => { }).catch((err) => {
console.error(`putBatch fail.code is ${err.code},message is ${err.message}`); console.error(`putBatch fail.code is ${err.code},message is ${err.message}`);
...@@ -2480,13 +2480,13 @@ delete(key: string, callback: AsyncCallback<void>): void ...@@ -2480,13 +2480,13 @@ delete(key: string, callback: AsyncCallback<void>): void
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
} }
console.info('Succeeded in putting'); console.info('Succeeded in putting');
kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err, data) { kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2540,9 +2540,9 @@ delete(key: string): Promise<void> ...@@ -2540,9 +2540,9 @@ delete(key: string): Promise<void>
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info(`Succeeded in putting: ${data}`); console.info(`Succeeded in putting data`);
kvStore.delete(KEY_TEST_STRING_ELEMENT).then((data) => { kvStore.delete(KEY_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in deleting'); console.info('Succeeded in deleting');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
...@@ -2595,13 +2595,13 @@ try { ...@@ -2595,13 +2595,13 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates(); let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"]; let arr = ["name"];
predicates.inKeys(arr); predicates.inKeys(arr);
kvStore.put("name", "bob", function (err, data) { kvStore.put("name", "bob", function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
} }
console.info("Succeeded in putting"); console.info("Succeeded in putting");
kvStore.delete(predicates, function (err, data) { kvStore.delete(predicates, function (err) {
if (err == undefined) { if (err == undefined) {
console.info('Succeeded in deleting'); console.info('Succeeded in deleting');
} else { } else {
...@@ -2660,9 +2660,9 @@ try { ...@@ -2660,9 +2660,9 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates(); let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"]; let arr = ["name"];
predicates.inKeys(arr); predicates.inKeys(arr);
kvStore.put("name", "bob").then((data) => { kvStore.put("name", "bob").then(() => {
console.info(`Succeeded in putting: ${data}`); console.info(`Succeeded in putting data`);
kvStore.delete(predicates).then((data) => { kvStore.delete(predicates).then(() => {
console.info('Succeeded in deleting'); console.info('Succeeded in deleting');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
...@@ -2724,13 +2724,13 @@ try { ...@@ -2724,13 +2724,13 @@ try {
keys.push(key + i); keys.push(key + i);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return; return;
} }
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
kvStore.deleteBatch(keys, async function (err, data) { kvStore.deleteBatch(keys, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -2797,9 +2797,9 @@ try { ...@@ -2797,9 +2797,9 @@ try {
keys.push(key + i); keys.push(key + i);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (data) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
kvStore.deleteBatch(keys).then((err) => { kvStore.deleteBatch(keys).then(() => {
console.info('Succeeded in deleting Batch'); console.info('Succeeded in deleting Batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
...@@ -2845,10 +2845,10 @@ removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void ...@@ -2845,10 +2845,10 @@ removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
console.info('Succeeded in putting data'); console.info('Succeeded in putting data');
const deviceid = 'no_exist_device_id'; const deviceid = 'no_exist_device_id';
kvStore.removeDeviceData(deviceid, async function (err, data) { kvStore.removeDeviceData(deviceid, async function (err) {
if (err == undefined) { if (err == undefined) {
console.info('succeeded in removing device data'); console.info('succeeded in removing device data');
} else { } else {
...@@ -2902,13 +2902,13 @@ removeDeviceData(deviceId: string): Promise<void> ...@@ -2902,13 +2902,13 @@ removeDeviceData(deviceId: string): Promise<void>
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-001'; const VALUE_TEST_STRING_ELEMENT = 'value-string-001';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((err) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in putting data'); console.info('Succeeded in putting data');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put data.code is ${err.code},message is ${err.message} `); console.error(`Failed to put data.code is ${err.code},message is ${err.message} `);
}); });
const deviceid = 'no_exist_device_id'; const deviceid = 'no_exist_device_id';
kvStore.removeDeviceData(deviceid).then((err) => { kvStore.removeDeviceData(deviceid).then(() => {
console.info('succeeded in removing device data'); console.info('succeeded in removing device data');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to remove device data.code is ${err.code},message is ${err.message} `); console.error(`Failed to remove device data.code is ${err.code},message is ${err.message} `);
...@@ -2954,7 +2954,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr ...@@ -2954,7 +2954,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3009,8 +3009,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array> ...@@ -3009,8 +3009,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array>
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info(`Succeeded in putting data.data=${data}`); console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => { kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`); console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => { }).catch((err) => {
...@@ -3065,7 +3065,7 @@ try { ...@@ -3065,7 +3065,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3132,7 +3132,7 @@ try { ...@@ -3132,7 +3132,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (entries) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => { kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries'); console.info('Succeeded in getting Entries');
...@@ -3190,7 +3190,7 @@ try { ...@@ -3190,7 +3190,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: {entries}`); console.info(`entries: {entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -3256,7 +3256,7 @@ try { ...@@ -3256,7 +3256,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: {entries}`); console.info(`entries: {entries}`);
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -3317,7 +3317,7 @@ try { ...@@ -3317,7 +3317,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3330,7 +3330,7 @@ try { ...@@ -3330,7 +3330,7 @@ try {
} }
console.info('Succeeded in getting result set'); console.info('Succeeded in getting result set');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3391,7 +3391,7 @@ try { ...@@ -3391,7 +3391,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -3402,7 +3402,7 @@ try { ...@@ -3402,7 +3402,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
...@@ -3454,7 +3454,7 @@ try { ...@@ -3454,7 +3454,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3522,7 +3522,7 @@ try { ...@@ -3522,7 +3522,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -3583,7 +3583,7 @@ try { ...@@ -3583,7 +3583,7 @@ try {
} }
console.info('Succeeded in getting result set'); console.info('Succeeded in getting result set');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -3643,7 +3643,7 @@ try { ...@@ -3643,7 +3643,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
...@@ -3673,7 +3673,7 @@ closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback<void>) ...@@ -3673,7 +3673,7 @@ closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback<void>)
```js ```js
try { try {
let resultSet = null; let resultSet = null;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err == undefined) { if (err == undefined) {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
} else { } else {
...@@ -3760,7 +3760,7 @@ try { ...@@ -3760,7 +3760,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -3822,7 +3822,7 @@ try { ...@@ -3822,7 +3822,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -3867,11 +3867,11 @@ backup(file:string, callback: AsyncCallback<void>):void ...@@ -3867,11 +3867,11 @@ backup(file:string, callback: AsyncCallback<void>):void
```js ```js
let file = "BK001"; let file = "BK001";
try { try {
kvStore.backup(file, (err, data) => { kvStore.backup(file, function(err) => {
if (err) { if (err) {
console.error(`Failed to backup.code is ${err.code},message is ${err.message} `); console.error(`Failed to backup.code is ${err.code},message is ${err.message} `);
} else { } else {
console.info(`Succeeded in backupping data.data=${data}`); console.info(`Succeeded in backupping data`);
} }
}); });
} catch (e) { } catch (e) {
...@@ -3912,8 +3912,8 @@ backup(file:string): Promise<void> ...@@ -3912,8 +3912,8 @@ backup(file:string): Promise<void>
```js ```js
let file = "BK001"; let file = "BK001";
try { try {
kvStore.backup(file).then((data) => { kvStore.backup(file).then(() => {
console.info(`Succeeded in backupping data.data=${data}`); console.info(`Succeeded in backupping data`);
}).catch((err) => { }).catch((err) => {
console.error(`Failed to backup.code is ${err.code},message is ${err.message}`); console.error(`Failed to backup.code is ${err.code},message is ${err.message}`);
}); });
...@@ -3950,11 +3950,11 @@ restore(file:string, callback: AsyncCallback<void>):void ...@@ -3950,11 +3950,11 @@ restore(file:string, callback: AsyncCallback<void>):void
```js ```js
let file = "BK001"; let file = "BK001";
try { try {
kvStore.restore(file, (err, data) => { kvStore.restore(file, (err) => {
if (err) { if (err) {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`); console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
} else { } else {
console.info(`Succeeded in restoring data.data=${data}`); console.info(`Succeeded in restoring data`);
} }
}); });
} catch (e) { } catch (e) {
...@@ -3995,8 +3995,8 @@ restore(file:string): Promise<void> ...@@ -3995,8 +3995,8 @@ restore(file:string): Promise<void>
```js ```js
let file = "BK001"; let file = "BK001";
try { try {
kvStore.restore(file).then((data) => { kvStore.restore(file).then(() => {
console.info(`Succeeded in restoring data.data=${data}`); console.info(`Succeeded in restoring data`);
}).catch((err) => { }).catch((err) => {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`); console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
}); });
...@@ -4124,7 +4124,7 @@ try { ...@@ -4124,7 +4124,7 @@ try {
console.info(`startTransaction 0 ${data}`); console.info(`startTransaction 0 ${data}`);
count++; count++;
}); });
kvStore.startTransaction(async function (err, data) { kvStore.startTransaction(async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`); console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4132,7 +4132,7 @@ try { ...@@ -4132,7 +4132,7 @@ try {
console.info('Succeeded in starting Transaction'); console.info('Succeeded in starting Transaction');
let entries = putBatchString(10, 'batch_test_string_key'); let entries = putBatchString(10, 'batch_test_string_key');
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4182,7 +4182,7 @@ try { ...@@ -4182,7 +4182,7 @@ try {
console.info(`startTransaction 0 ${data}`); console.info(`startTransaction 0 ${data}`);
count++; count++;
}); });
kvStore.startTransaction().then(async (err) => { kvStore.startTransaction().then(async () => {
console.info('Succeeded in starting Transaction'); console.info('Succeeded in starting Transaction');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`); console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
...@@ -4218,7 +4218,7 @@ commit(callback: AsyncCallback<void>): void ...@@ -4218,7 +4218,7 @@ commit(callback: AsyncCallback<void>): void
```js ```js
try { try {
kvStore.commit(function (err, data) { kvStore.commit(function (err) {
if (err == undefined) { if (err == undefined) {
console.info('Succeeded in committing'); console.info('Succeeded in committing');
} else { } else {
...@@ -4256,7 +4256,7 @@ commit(): Promise<void> ...@@ -4256,7 +4256,7 @@ commit(): Promise<void>
```js ```js
try { try {
kvStore.commit().then(async (err) => { kvStore.commit().then(async () => {
console.info('Succeeded in committing'); console.info('Succeeded in committing');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to commit.code is ${err.code},message is ${err.message}`); console.error(`Failed to commit.code is ${err.code},message is ${err.message}`);
...@@ -4292,7 +4292,7 @@ rollback(callback: AsyncCallback<void>): void ...@@ -4292,7 +4292,7 @@ rollback(callback: AsyncCallback<void>): void
```js ```js
try { try {
kvStore.rollback(function (err,data) { kvStore.rollback(function (err) {
if (err == undefined) { if (err == undefined) {
console.info('Succeeded in rolling back'); console.info('Succeeded in rolling back');
} else { } else {
...@@ -4330,7 +4330,7 @@ rollback(): Promise<void> ...@@ -4330,7 +4330,7 @@ rollback(): Promise<void>
```js ```js
try { try {
kvStore.rollback().then(async (err) => { kvStore.rollback().then(async () => {
console.info('Succeeded in rolling back'); console.info('Succeeded in rolling back');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to rollback.code is ${err.code},message is ${err.message}`); console.error(`Failed to rollback.code is ${err.code},message is ${err.message}`);
...@@ -4359,7 +4359,7 @@ enableSync(enabled: boolean, callback: AsyncCallback<void>): void ...@@ -4359,7 +4359,7 @@ enableSync(enabled: boolean, callback: AsyncCallback<void>): void
```js ```js
try { try {
kvStore.enableSync(true, function (err, data) { kvStore.enableSync(true, function (err) {
if (err == undefined) { if (err == undefined) {
console.info('Succeeded in enabling sync'); console.info('Succeeded in enabling sync');
} else { } else {
...@@ -4395,7 +4395,7 @@ enableSync(enabled: boolean): Promise<void> ...@@ -4395,7 +4395,7 @@ enableSync(enabled: boolean): Promise<void>
```js ```js
try { try {
kvStore.enableSync(true).then((err) => { kvStore.enableSync(true).then(() => {
console.info('Succeeded in enabling sync'); console.info('Succeeded in enabling sync');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to enable sync.code is ${err.code},message is ${err.message}`); console.error(`Failed to enable sync.code is ${err.code},message is ${err.message}`);
...@@ -4427,7 +4427,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: Asy ...@@ -4427,7 +4427,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: Asy
try { try {
const localLabels = ['A', 'B']; const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D']; const remoteSupportLabels = ['C', 'D'];
kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err, data) { kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`); console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4466,7 +4466,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise<v ...@@ -4466,7 +4466,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise<v
try { try {
const localLabels = ['A', 'B']; const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D']; const remoteSupportLabels = ['C', 'D'];
kvStore.setSyncRange(localLabels, remoteSupportLabels).then((err) => { kvStore.setSyncRange(localLabels, remoteSupportLabels).then(() => {
console.info('Succeeded in setting syncRange'); console.info('Succeeded in setting syncRange');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`); console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
...@@ -4496,7 +4496,7 @@ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback<void>) ...@@ -4496,7 +4496,7 @@ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback<void>)
```js ```js
try { try {
const defaultAllowedDelayMs = 500; const defaultAllowedDelayMs = 500;
kvStore.setSyncParam(defaultAllowedDelayMs, function (err, data) { kvStore.setSyncParam(defaultAllowedDelayMs, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`); console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4533,7 +4533,7 @@ setSyncParam(defaultAllowedDelayMs: number): Promise<void> ...@@ -4533,7 +4533,7 @@ setSyncParam(defaultAllowedDelayMs: number): Promise<void>
```js ```js
try { try {
const defaultAllowedDelayMs = 500; const defaultAllowedDelayMs = 500;
kvStore.setSyncParam(defaultAllowedDelayMs).then((err) => { kvStore.setSyncParam(defaultAllowedDelayMs).then(() => {
console.info('Succeeded in setting syncParam'); console.info('Succeeded in setting syncParam');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`); console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
...@@ -4596,7 +4596,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => { ...@@ -4596,7 +4596,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
kvStore.on('syncComplete', function (data) { kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange'); console.info('Sync dataChange');
}); });
kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`); console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4666,7 +4666,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => { ...@@ -4666,7 +4666,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
kvStore.on('syncComplete', function (data) { kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange'); console.info('Sync dataChange');
}); });
kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`); console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -4746,7 +4746,7 @@ try { ...@@ -4746,7 +4746,7 @@ try {
kvStore.on('syncComplete', function (data) { kvStore.on('syncComplete', function (data) {
console.info(`syncComplete ${data}`); console.info(`syncComplete ${data}`);
}); });
kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then((data) => { kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then(() => {
console.info('succeeded in putting'); console.info('succeeded in putting');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
...@@ -4969,7 +4969,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr ...@@ -4969,7 +4969,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5024,8 +5024,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array> ...@@ -5024,8 +5024,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array>
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info(`Succeeded in putting data.data=${data}`); console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => { kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`); console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => { }).catch((err) => {
...@@ -5075,7 +5075,7 @@ get(deviceId: string, key: string, callback: AsyncCallback<boolean | string | ...@@ -5075,7 +5075,7 @@ get(deviceId: string, key: string, callback: AsyncCallback<boolean | string |
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`); console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5135,7 +5135,7 @@ get(deviceId: string, key: string): Promise<boolean | string | number | Uint8 ...@@ -5135,7 +5135,7 @@ get(deviceId: string, key: string): Promise<boolean | string | number | Uint8
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try { try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async (data) => { kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async () => {
console.info('Succeeded in putting'); console.info('Succeeded in putting');
kvStore.get('localDeviceId', KEY_TEST_STRING_ELEMENT).then((data) => { kvStore.get('localDeviceId', KEY_TEST_STRING_ELEMENT).then((data) => {
console.info('Succeeded in getting'); console.info('Succeeded in getting');
...@@ -5191,7 +5191,7 @@ try { ...@@ -5191,7 +5191,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5258,7 +5258,7 @@ try { ...@@ -5258,7 +5258,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (entries) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => { kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries'); console.info('Succeeded in getting Entries');
...@@ -5320,7 +5320,7 @@ try { ...@@ -5320,7 +5320,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries : ${entries}`); console.info(`entries : ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5392,7 +5392,7 @@ try { ...@@ -5392,7 +5392,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => { kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => {
console.info('Succeeded in getting entries'); console.info('Succeeded in getting entries');
...@@ -5453,7 +5453,7 @@ try { ...@@ -5453,7 +5453,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: {entries}`); console.info(`entries: {entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -5519,7 +5519,7 @@ try { ...@@ -5519,7 +5519,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: {entries}`); console.info(`entries: {entries}`);
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch'); console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -5584,7 +5584,7 @@ try { ...@@ -5584,7 +5584,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5661,7 +5661,7 @@ try { ...@@ -5661,7 +5661,7 @@ try {
entries.push(entry); entries.push(entry);
} }
console.info(`entries: ${entries}`); console.info(`entries: ${entries}`);
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
var query = new distributedKVStore.Query(); var query = new distributedKVStore.Query();
query.deviceId('localDeviceId'); query.deviceId('localDeviceId');
...@@ -5722,7 +5722,7 @@ try { ...@@ -5722,7 +5722,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5735,7 +5735,7 @@ try { ...@@ -5735,7 +5735,7 @@ try {
} }
console.info('Succeeded in getting result set'); console.info('Succeeded in getting result set');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5796,7 +5796,7 @@ try { ...@@ -5796,7 +5796,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -5807,7 +5807,7 @@ try { ...@@ -5807,7 +5807,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
...@@ -5859,7 +5859,7 @@ try { ...@@ -5859,7 +5859,7 @@ try {
} }
console.info('Succeeded in getting resultSet'); console.info('Succeeded in getting resultSet');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5918,7 +5918,7 @@ try { ...@@ -5918,7 +5918,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultSet.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet'); console.info('Succeeded in closing resultSet');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
...@@ -5975,7 +5975,7 @@ try { ...@@ -5975,7 +5975,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -5990,7 +5990,7 @@ try { ...@@ -5990,7 +5990,7 @@ try {
} }
console.info('Succeeded in getting resultSet'); console.info('Succeeded in getting resultSet');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6056,7 +6056,7 @@ try { ...@@ -6056,7 +6056,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -6071,7 +6071,7 @@ try { ...@@ -6071,7 +6071,7 @@ try {
}); });
query.deviceId('localDeviceId'); query.deviceId('localDeviceId');
console.info("GetResultSet " + query.getSqlLike()); console.info("GetResultSet " + query.getSqlLike());
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet'); console.info('Succeeded in closing resultSet');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
...@@ -6129,7 +6129,7 @@ try { ...@@ -6129,7 +6129,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -6194,7 +6194,7 @@ try { ...@@ -6194,7 +6194,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6209,7 +6209,7 @@ try { ...@@ -6209,7 +6209,7 @@ try {
} }
console.info('Succeeded in getting resultSet'); console.info('Succeeded in getting resultSet');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6266,7 +6266,7 @@ try { ...@@ -6266,7 +6266,7 @@ try {
} }
console.info('Succeeded in getting result set'); console.info('Succeeded in getting result set');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6326,7 +6326,7 @@ try { ...@@ -6326,7 +6326,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
...@@ -6384,7 +6384,7 @@ try { ...@@ -6384,7 +6384,7 @@ try {
} }
console.info('Succeeded in getting result set'); console.info('Succeeded in getting result set');
resultSet = result; resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) { kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6449,7 +6449,7 @@ try { ...@@ -6449,7 +6449,7 @@ try {
}).catch((err) => { }).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
}); });
kvStore.closeResultSet(resultSet).then((err) => { kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set'); console.info('Succeeded in closing result set');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
...@@ -6499,7 +6499,7 @@ try { ...@@ -6499,7 +6499,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query(); const query = new distributedKVStore.Query();
query.prefixKey("batch_test"); query.prefixKey("batch_test");
...@@ -6561,7 +6561,7 @@ try { ...@@ -6561,7 +6561,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
...@@ -6623,7 +6623,7 @@ try { ...@@ -6623,7 +6623,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries, async function (err, data) { kvStore.putBatch(entries, async function (err) {
if (err != undefined) { if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return; return;
...@@ -6695,7 +6695,7 @@ try { ...@@ -6695,7 +6695,7 @@ try {
} }
entries.push(entry); entries.push(entry);
} }
kvStore.putBatch(entries).then(async (err) => { kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch'); console.info('Succeeded in putting batch');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册