提交 7c327447 编写于 作者: D dangyifei

delete some comment

上级 53b16606
...@@ -27,7 +27,6 @@ class CROVLBuilderIncremental { ...@@ -27,7 +27,6 @@ class CROVLBuilderIncremental {
static const uint32_t INDEX_BUFFER = 4194304; static const uint32_t INDEX_BUFFER = 4194304;
int _index_type; int _index_type;
uint32_t _data_file_len; uint32_t _data_file_len;
// hdfs _index_file;
uint64_t _data_file; uint64_t _data_file;
uint32_t _data_buf_len; uint32_t _data_buf_len;
uint32_t _index_buf_len; uint32_t _index_buf_len;
...@@ -39,12 +38,6 @@ class CROVLBuilderIncremental { ...@@ -39,12 +38,6 @@ class CROVLBuilderIncremental {
uint32_t _fix_len; uint32_t _fix_len;
uint32_t _rec_size; uint32_t _rec_size;
// hdfsFS _fs;
// hdfsFile _file;
// AfsFileSystem* _afs_conn;
// Writer* _index_writer;
uint64_t* _index; uint64_t* _index;
char* _data; char* _data;
std::vector<uint32_t> _data_file_list; std::vector<uint32_t> _data_file_list;
...@@ -74,15 +67,12 @@ class CROVLBuilderIncremental { ...@@ -74,15 +67,12 @@ class CROVLBuilderIncremental {
std::string _id; std::string _id;
std::string _key; std::string _key;
std::string _extra; std::string _extra;
// std::string _afs_regin;
public: public:
CROVLBuilderIncremental(); CROVLBuilderIncremental();
~CROVLBuilderIncremental(); ~CROVLBuilderIncremental();
// bool set_sort_arg(uint64_t inner_sort_size, uint64_t memory_quota);
bool Init(int index_type, bool Init(int index_type,
uint32_t data_file_len, uint32_t data_file_len,
const char* mode, const char* mode,
......
...@@ -82,7 +82,7 @@ class FileRawReader : public RawReader { ...@@ -82,7 +82,7 @@ class FileRawReader : public RawReader {
return -1; return -1;
} }
virtual int64_t read(char* v) { 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()) if (_reader.good())
return sizeof(char); return sizeof(char);
else if (_reader.eof()) else if (_reader.eof())
......
...@@ -22,11 +22,6 @@ ...@@ -22,11 +22,6 @@
class SequenceFileRecordReader : public RecordReader { class SequenceFileRecordReader : public RecordReader {
public: public:
SequenceFileRecordReader() {} SequenceFileRecordReader() {}
// SequenceFileRecordReader(const std::string& path, AfsFileSystemPtr fs) {
// _path = path;
// _fs = fs;
// _raw_reader = new AFsRawReader(_path, _fs);
// }
explicit SequenceFileRecordReader(const std::string& path) { explicit SequenceFileRecordReader(const std::string& path) {
_path = path; _path = path;
_raw_reader = new FileRawReader(_path); _raw_reader = new FileRawReader(_path);
...@@ -44,7 +39,6 @@ class SequenceFileRecordReader : public RecordReader { ...@@ -44,7 +39,6 @@ class SequenceFileRecordReader : public RecordReader {
private: private:
std::string _path{""}; std::string _path{""};
// AfsFileSystemPtr _fs {nullptr};
RawReader* _raw_reader{nullptr}; RawReader* _raw_reader{nullptr};
Header _header; Header _header;
}; };
......
...@@ -32,33 +32,6 @@ class VInt { ...@@ -32,33 +32,6 @@ class VInt {
static bool is_negative_vint(const char &value) { static bool is_negative_vint(const char &value) {
return value < -120 || (value >= -112 && value < 0); 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) { static bool read_vint(RawReader *reader, int32_t *vint) {
char first_byte; char first_byte;
if (reader->read(&first_byte) <= 0) { if (reader->read(&first_byte) <= 0) {
......
...@@ -61,11 +61,6 @@ void mapFileLocal(Job job, ...@@ -61,11 +61,6 @@ void mapFileLocal(Job job,
uint64_t key = uint64_t key =
*reinterpret_cast<uint64_t *>(const_cast<char *>(record.key.data())); *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++; total_count++;
int part = key % job.get_shard_num(); int part = key % job.get_shard_num();
int64_t value_length = record.record_len - record.key_len; int64_t value_length = record.record_len - record.key_len;
......
...@@ -156,10 +156,6 @@ bool CROVLBuilderIncremental::Init(int index_type, ...@@ -156,10 +156,6 @@ bool CROVLBuilderIncremental::Init(int index_type,
if (_master_address == "") { if (_master_address == "") {
if (!read_last_meta_from_local()) { if (!read_last_meta_from_local()) {
LOG(ERROR) << "read last meta from db error! "; 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; return false;
} }
} else { } else {
...@@ -182,7 +178,7 @@ bool CROVLBuilderIncremental::flush_data() { ...@@ -182,7 +178,7 @@ bool CROVLBuilderIncremental::flush_data() {
} }
char file[MAX_DATA_DIR_LEN * 2]; 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; FILE *fp;
if ((fp = fopen(file, "wb")) == NULL) { if ((fp = fopen(file, "wb")) == NULL) {
LOG(ERROR) << "open file failed! " << file; LOG(ERROR) << "open file failed! " << file;
...@@ -390,7 +386,7 @@ bool CROVLBuilderIncremental::done() { ...@@ -390,7 +386,7 @@ bool CROVLBuilderIncremental::done() {
// fix empty data bug // fix empty data bug
// if the version no data, filter this version, index_file_num no add // 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) { if (_cur_count > 0) {
*reinterpret_cast<uint32_t *>(buffer) = ++_index_file_num; *reinterpret_cast<uint32_t *>(buffer) = ++_index_file_num;
} else { } else {
......
...@@ -143,9 +143,6 @@ std::string CurlSimple::curl_post( ...@@ -143,9 +143,6 @@ std::string CurlSimple::curl_post(
if (res != CURLE_OK) { if (res != CURLE_OK) {
std::cerr << "curl_easy_perform() failed:" << curl_easy_strerror(res) std::cerr << "curl_easy_perform() failed:" << curl_easy_strerror(res)
<< std::endl; << std::endl;
// return "";
// fprintf(stderr, "curl_easy_perform() failed: %s\n",
// curl_easy_strerror(res));
} else { } else {
/* /*
* Now, our chunk.memory points to a memory block that is chunk.size * Now, our chunk.memory points to a memory block that is chunk.size
......
...@@ -44,8 +44,6 @@ int main(int argc, char *argv[]) { ...@@ -44,8 +44,6 @@ int main(int argc, char *argv[]) {
LOG(INFO) << "start"; 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 last_version = std::to_string(FLAGS_last_version);
string cur_version = std::to_string(FLAGS_cur_version); string cur_version = std::to_string(FLAGS_cur_version);
string depend_version = std::to_string(FLAGS_depend_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.
先完成此消息的编辑!
想要评论请 注册