提交 982d3e34 编写于 作者: D dangyifei

delete some comment

上级 dd65660f
......@@ -27,7 +27,6 @@ class CROVLBuilderIncremental {
static const uint32_t INDEX_BUFFER = 4194304;
int _index_type;
uint32_t _data_file_len;
// hdfs _index_file;
uint64_t _data_file;
uint32_t _data_buf_len;
uint32_t _index_buf_len;
......@@ -39,12 +38,6 @@ class CROVLBuilderIncremental {
uint32_t _fix_len;
uint32_t _rec_size;
// hdfsFS _fs;
// hdfsFile _file;
// AfsFileSystem* _afs_conn;
// Writer* _index_writer;
uint64_t* _index;
char* _data;
std::vector<uint32_t> _data_file_list;
......@@ -74,15 +67,12 @@ class CROVLBuilderIncremental {
std::string _id;
std::string _key;
std::string _extra;
// std::string _afs_regin;
public:
CROVLBuilderIncremental();
~CROVLBuilderIncremental();
// bool set_sort_arg(uint64_t inner_sort_size, uint64_t memory_quota);
bool Init(int index_type,
uint32_t data_file_len,
const char* mode,
......
......@@ -82,7 +82,7 @@ class FileRawReader : public RawReader {
return -1;
}
virtual int64_t read(char* v) {
_reader.read(reinterpret_cast<char*>(*v), sizeof(char));
_reader.read(reinterpret_cast<char*>(v), sizeof(char));
if (_reader.good())
return sizeof(char);
else if (_reader.eof())
......
......@@ -22,11 +22,6 @@
class SequenceFileRecordReader : public RecordReader {
public:
SequenceFileRecordReader() {}
// SequenceFileRecordReader(const std::string& path, AfsFileSystemPtr fs) {
// _path = path;
// _fs = fs;
// _raw_reader = new AFsRawReader(_path, _fs);
// }
explicit SequenceFileRecordReader(const std::string& path) {
_path = path;
_raw_reader = new FileRawReader(_path);
......@@ -44,7 +39,6 @@ class SequenceFileRecordReader : public RecordReader {
private:
std::string _path{""};
// AfsFileSystemPtr _fs {nullptr};
RawReader* _raw_reader{nullptr};
Header _header;
};
......
......@@ -32,33 +32,6 @@ class VInt {
static bool is_negative_vint(const char &value) {
return value < -120 || (value >= -112 && value < 0);
}
// todo
/*static int32_t writeVInt(OutputStream& os, int i) {
int32_t rc = 0;
if (i >= -112 && i <= 127) {
rc = os.write((char*)&i, (int64_t)sizeof(char));
return rc;
}
int len = -112;
if (i < 0) {
i ^= -1L; // take one's complement'
len = -120;
}
int32_t tmp = i;
while (tmp != 0) {
tmp = tmp >> 8;
len--;
}
os.write((char*)&len, sizeof(char));
len = (len < -120) ? -(len + 120) : -(len + 112);
for (int idx = len - 1; idx >= 0; idx--) {
int32_t shiftbits = idx * 8;
int mask = 0xFFL << shiftbits;
int val = (i & mask) >> shiftbits;
os.write((char*)&val, sizeof(char));
}
return rc;
}*/
static bool read_vint(RawReader *reader, int32_t *vint) {
char first_byte;
if (reader->read(&first_byte) <= 0) {
......
......@@ -61,11 +61,6 @@ void mapFileLocal(Job job,
uint64_t key =
*reinterpret_cast<uint64_t *>(const_cast<char *>(record.key.data()));
// printf("key:%lu yu:%lu value:%s \n", key, key%job.get_shard_num(),
// string_to_hex(record.value).c_str());
// printf("key_length:%llu value_length:%llu \n", record.key.length(),
// record.value.length());
// fprintf(stdout, "key:%lu value:%s\n", key, record.value.c_str());
total_count++;
int part = key % job.get_shard_num();
int64_t value_length = record.record_len - record.key_len;
......
......@@ -156,10 +156,6 @@ bool CROVLBuilderIncremental::Init(int index_type,
if (_master_address == "") {
if (!read_last_meta_from_local()) {
LOG(ERROR) << "read last meta from db error! ";
// if (!read_last_meta_from_hdfs()) {
// fprintf(stderr, "read last meta from hdfs error\n");
// return false;
//}
return false;
}
} else {
......@@ -182,7 +178,7 @@ bool CROVLBuilderIncremental::flush_data() {
}
char file[MAX_DATA_DIR_LEN * 2];
snprintf(file, sizeof(file), "%s/data.%llu", _data_dir, _data_file);
snprintf(file, sizeof(file), "%s/data.%lu", _data_dir, _data_file);
FILE *fp;
if ((fp = fopen(file, "wb")) == NULL) {
LOG(ERROR) << "open file failed! " << file;
......@@ -390,7 +386,7 @@ bool CROVLBuilderIncremental::done() {
// fix empty data bug
// if the version no data, filter this version, index_file_num no add
// only can patch is null, not bae
// only can patch is null, not base
if (_cur_count > 0) {
*reinterpret_cast<uint32_t *>(buffer) = ++_index_file_num;
} else {
......
......@@ -143,9 +143,6 @@ std::string CurlSimple::curl_post(
if (res != CURLE_OK) {
std::cerr << "curl_easy_perform() failed:" << curl_easy_strerror(res)
<< std::endl;
// return "";
// fprintf(stderr, "curl_easy_perform() failed: %s\n",
// curl_easy_strerror(res));
} else {
/*
* Now, our chunk.memory points to a memory block that is chunk.size
......
......@@ -44,8 +44,6 @@ int main(int argc, char *argv[]) {
LOG(INFO) << "start";
// string f = "/";
// string output_path = argv[7] + f + depend_version + "_" + cur_version;
string last_version = std::to_string(FLAGS_last_version);
string cur_version = std::to_string(FLAGS_cur_version);
string depend_version = std::to_string(FLAGS_depend_version);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册