Skip to content

Commit

Permalink
添加Put异步请求失败回调的内容
Browse files Browse the repository at this point in the history
  • Loading branch information
AlionSSS committed May 9, 2019
1 parent a9d642d commit 92874a6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ client.putAsync("tb_test", putList, new PutCallback() {
}

@Override
public void onFailed(Exception e) {
public void onFailed(Exception e, List<Put> puts) {
System.out.println("GetTest.onFailed 提交Put失败!");
System.out.println("失败的 puts = " + puts);
}
});
```
Expand Down
2 changes: 1 addition & 1 deletion src/com/skey/evehbase/client/EveHBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void putAsync(@Nonnull String tableName, @Nonnull List<Put> putList, PutC
put(tableName, putList);
if (callback != null) callback.onSuccessful();
} catch (IOException e) {
if (callback != null) callback.onFailed(e);
if (callback != null) callback.onFailed(e, putList);
}
});
}
Expand Down
6 changes: 5 additions & 1 deletion src/com/skey/evehbase/request/PutCallback.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.skey.evehbase.request;


import org.apache.hadoop.hbase.client.Put;

import java.util.List;

/**
* HBase Put 回调接口
* <p>
Expand All @@ -12,6 +16,6 @@ public interface PutCallback {

void onSuccessful();

void onFailed(Exception e);
void onFailed(Exception e, List<Put> puts);

}
3 changes: 2 additions & 1 deletion test/com/skey/evehbase/GetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ public void onFailed(Exception e) {
// }
//
// @Override
// public void onFailed(Exception e) {
// public void onFailed(Exception e, List<Put> puts) {
// System.out.println("GetTest.onFailed 提交Put失败!");
// System.out.println("失败的 puts = " + puts);
// }
// });
// client.putAsync("tb_test", putList, null);
Expand Down

0 comments on commit 92874a6

Please sign in to comment.