Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FileExists and DeleteFile to Env #174

Merged
merged 1 commit into from
Dec 11, 2017
Merged

Add FileExists and DeleteFile to Env #174

merged 1 commit into from
Dec 11, 2017

Conversation

huachaohuang
Copy link

No description provided.

@UncP
Copy link

UncP commented Dec 11, 2017

LGTM

SaveError(errptr, env->rep->FileExists(path));
}

void crocksdb_env_delete_file(crocksdb_env_t* env, const char* path, char** errptr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete it via Env? Why not just use fs::remove_file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because file can be any kind of types, for example memory sst file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a link to the explanation of memory SST file? Does it have a path?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RocksDB, Env is an interface to abstract some platform-dependent APIs.
For example, I can provide a MemEnv, which maintains a virtual file system in memory.
Then I can create a SstFileWriter with the MemEnv to generate SST file in memory.

Ref: https://github.com/facebook/rocksdb/blob/master/env/mock_env.h

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the information.

Copy link
Member

@zhangjinpeng87 zhangjinpeng87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huachaohuang huachaohuang merged commit e6492cb into tikv:master Dec 11, 2017
@huachaohuang huachaohuang deleted the delete-file branch December 11, 2017 05:44
yiwu-arbug pushed a commit that referenced this pull request Jun 4, 2020
update titan to include tikv/titan#169 for tikv-4.x

include the following changes
```
81814ec 2020-06-04 zbk602423539@gmail.. Fix GC may delete a already deleted blob file (#168) (#169)
80657c0 2020-06-04 zbk602423539@gmail.. Fix wrong assert delta < 0 for cocurrent compaction while flush (#172) (#176)
0db7976 2020-06-04 sre-bot@pingcap.com  Fix wrong live data size when encounter rewrite failure (#161) (#175)
c41f2a2 2020-06-04 sre-bot@pingcap.com  feat: Titan should return user value to compaction filter #163 (#164) (#174)
```

Signed-off-by: sre-bot <sre-bot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants