-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small cleanup to jvm iter adapter. (#9616)
- Remove header dependency on c_api - Remove remaining code for arrow.
- Loading branch information
1 parent
417c3ba
commit d95be1c
Showing
5 changed files
with
43 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2019-2023, XGBoost Contributors | ||
*/ | ||
#include "adapter.h" | ||
|
||
#include "../c_api/c_api_error.h" // for API_BEGIN, API_END | ||
#include "xgboost/c_api.h" | ||
|
||
namespace xgboost::data { | ||
template <typename DataIterHandle, typename XGBCallbackDataIterNext, typename XGBoostBatchCSR> | ||
bool IteratorAdapter<DataIterHandle, XGBCallbackDataIterNext, XGBoostBatchCSR>::Next() { | ||
if ((*next_callback_)( | ||
data_handle_, | ||
[](void *handle, XGBoostBatchCSR batch) -> int { | ||
API_BEGIN(); | ||
static_cast<IteratorAdapter *>(handle)->SetData(batch); | ||
API_END(); | ||
}, | ||
this) != 0) { | ||
at_first_ = false; | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
template class IteratorAdapter<DataIterHandle, XGBCallbackDataIterNext, XGBoostBatchCSR>; | ||
} // namespace xgboost::data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters