Skip to content

Commit

Permalink
revert scheme and test plan changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shbhmrzd committed Apr 23, 2024
1 parent b3b4435 commit 77acd20
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .github/scripts/test_behavior/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,9 @@ def generate_language_binding_cases(
) -> list[dict[str, str]]:
cases = unique_cases(cases)

# Remove specified services cases for java.
excluded_services = {"hdfs", "hdfs-native"} # Use a set for faster lookups
# Remove hdfs cases for java.
if language == "java":
cases = [v for v in cases if v["service"] not in excluded_services]
cases = [v for v in cases if v["service"] != "hdfs"]

if os.getenv("GITHUB_IS_PUSH") == "true":
return cases
Expand Down
2 changes: 1 addition & 1 deletion .github/services/hdfs_native/hdfs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ runs:
CLASSPATH=${CLASSPATH}
LD_LIBRARY_PATH=${JAVA_HOME}/lib/server:${HADOOP_HOME}/lib/native
OPENDAL_HDFS_NATIVE_ROOT=/tmp/opendal/
OPENDAL_HDFS_NATIVE_URL=http://127.0.0.1:9000
OPENDAL_HDFS_NATIVE_URL=hdfs://127.0.0.1:9000
OPENDAL_HDFS_NATIVE_ENABLE_APPEND=false
EOF
5 changes: 2 additions & 3 deletions core/src/services/hdfs_native/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ impl HdfsNativeWriter {
impl oio::Write for HdfsNativeWriter {
async fn write(&mut self, bs: Buffer) -> Result<usize> {
let bytes = bs.to_bytes();
let total_bytes = bytes.len();
self.f.write(bytes).await.map_err(parse_hdfs_error)?;
Ok(total_bytes)
let n = self.f.write(bytes).await.map_err(parse_hdfs_error)?;
Ok(n)
}

async fn close(&mut self) -> Result<()> {
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ impl FromStr for Scheme {
"tikv" => Ok(Scheme::Tikv),
"azfile" => Ok(Scheme::Azfile),
"mongodb" => Ok(Scheme::Mongodb),
"hdfs-native" => Ok(Scheme::HdfsNative),
"hdfs_native" => Ok(Scheme::HdfsNative),
"surrealdb" => Ok(Scheme::Surrealdb),
_ => Ok(Scheme::Custom(Box::leak(s.into_boxed_str()))),
}
Expand Down Expand Up @@ -454,7 +454,7 @@ impl From<Scheme> for &'static str {
Scheme::Upyun => "upyun",
Scheme::YandexDisk => "yandex_disk",
Scheme::Pcloud => "pcloud",
Scheme::HdfsNative => "hdfs-native",
Scheme::HdfsNative => "hdfs_native",
Scheme::Surrealdb => "surrealdb",
Scheme::Custom(v) => v,
}
Expand Down

0 comments on commit 77acd20

Please sign in to comment.