chaoyli closed pull request #501: Make schema_change can be compiled
URL: https://github.com/apache/incubator-doris/pull/501
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/be/src/olap/CMakeLists.txt b/be/src/olap/CMakeLists.txt
index 8d248718..3519e16a 100644
--- a/be/src/olap/CMakeLists.txt
+++ b/be/src/olap/CMakeLists.txt
@@ -55,7 +55,7 @@ add_library(Olap STATIC
reader.cpp
row_block.cpp
row_cursor.cpp
- #schema_change.cpp
+ schema_change.cpp
serialize.cpp
storage_engine.cpp
data_dir.cpp
diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp
index aa46862b..b79bc610 100644
--- a/be/src/olap/push_handler.cpp
+++ b/be/src/olap/push_handler.cpp
@@ -346,6 +346,7 @@ OLAPStatus PushHandler::_convert(
delta_segment_group = new(std::nothrow) SegmentGroup(
curr_tablet->tablet_id(),
+ 0,
curr_tablet->tablet_schema(),
curr_tablet->num_key_fields(),
curr_tablet->num_short_key_fields(),
@@ -356,6 +357,7 @@ OLAPStatus PushHandler::_convert(
} else {
delta_segment_group = new(std::nothrow) SegmentGroup(
curr_tablet->tablet_id(),
+ 0,
curr_tablet->tablet_schema(),
curr_tablet->num_key_fields(),
curr_tablet->num_short_key_fields(),
diff --git a/be/src/olap/rowset/alpha_rowset.cpp
b/be/src/olap/rowset/alpha_rowset.cpp
index 9b88b194..1c5e11bc 100644
--- a/be/src/olap/rowset/alpha_rowset.cpp
+++ b/be/src/olap/rowset/alpha_rowset.cpp
@@ -81,7 +81,7 @@ OLAPStatus AlphaRowset::_init_segment_groups() {
Version version = _rowset_meta->version();
int64_t version_hash = _rowset_meta->get_version_hash();
std::shared_ptr<SegmentGroup> segment_group(new
SegmentGroup(_rowset_meta->get_tablet_id(),
- _rowset_meta->get_rowset_id(), _tablet_schema,
_num_key_fields, _num_short_key_fields,
+ _rowset_meta->rowset_id(), _tablet_schema, _num_key_fields,
_num_short_key_fields,
_num_rows_per_row_block, _rowset_path, version, version_hash,
false, segment_group_meta.segment_group_id(),
segment_group_meta.num_segments()));
if (segment_group.get() == nullptr) {
diff --git a/be/src/olap/rowset/column_data.cpp
b/be/src/olap/rowset/column_data.cpp
index 905ea819..ba1afede 100644
--- a/be/src/olap/rowset/column_data.cpp
+++ b/be/src/olap/rowset/column_data.cpp
@@ -127,7 +127,7 @@ OLAPStatus ColumnData::_seek_to_block(const
RowBlockPosition& block_pos, bool wi
_segment_reader = new(std::nothrow) SegmentReader(
file_name, segment_group(), block_pos.segment,
_seek_columns, _load_bf_columns, _conditions,
- _delete_handler, _delete_status, _runtime_state, _stats,
_lru_cache);
+ _delete_handler, _delete_status, _lru_cache, _runtime_state,
_stats);
if (_segment_reader == nullptr) {
OLAP_LOG_WARNING("fail to malloc segment reader.");
return OLAP_ERR_MALLOC_ERROR;
@@ -704,4 +704,4 @@ OLAPStatus ColumnData::_get_block(bool without_filter) {
return OLAP_SUCCESS;
}
-} // namespace doris
\ No newline at end of file
+} // namespace doris
diff --git a/be/src/olap/rowset/rowset_meta.h b/be/src/olap/rowset/rowset_meta.h
index 9e1b695d..1a4e6719 100644
--- a/be/src/olap/rowset/rowset_meta.h
+++ b/be/src/olap/rowset/rowset_meta.h
@@ -52,8 +52,6 @@ class RowsetMeta {
return ret;
}
- virtual bool init_from_pb(const RowsetMetaPB& rs_meta_pb);
-
virtual bool deserialize_extra_properties() {
return true;
}
diff --git a/be/src/olap/rowset/segment_reader.cpp
b/be/src/olap/rowset/segment_reader.cpp
index 8096eb4e..9f5d1fb1 100644
--- a/be/src/olap/rowset/segment_reader.cpp
+++ b/be/src/olap/rowset/segment_reader.cpp
@@ -41,12 +41,14 @@ SegmentReader::SegmentReader(
const Conditions* conditions,
const DeleteHandler& delete_handler,
const DelCondSatisfied delete_status,
+ Cache* lru_cache,
RuntimeState* runtime_state,
- OlapReaderStatistics* stats,
- Cache* lru_cache) :
+ OlapReaderStatistics* stats) :
_file_name(file),
_segment_group(segment_group),
_segment_id(segment_id),
+ _used_columns(used_columns),
+ _load_bf_columns(load_bf_columns),
_conditions(conditions),
_delete_handler(delete_handler),
_delete_status(delete_status),
@@ -56,16 +58,14 @@ SegmentReader::SegmentReader(
_block_count(0),
_num_rows_in_block(0),
_null_supported(false),
- _used_columns(used_columns),
- _load_bf_columns(load_bf_columns),
_mmap_buffer(NULL),
_include_blocks(NULL),
_is_using_mmap(false),
_is_data_loaded(false),
_buffer_size(0),
+ _shared_buffer(NULL),
_lru_cache(lru_cache),
_runtime_state(runtime_state),
- _shared_buffer(NULL),
_stats(stats) {
_tracker.reset(new MemTracker(-1));
_mem_pool.reset(new MemPool(_tracker.get()));
diff --git a/be/src/olap/rowset/segment_reader.h
b/be/src/olap/rowset/segment_reader.h
index e198ba1a..dd9b74d0 100644
--- a/be/src/olap/rowset/segment_reader.h
+++ b/be/src/olap/rowset/segment_reader.h
@@ -56,9 +56,9 @@ class SegmentReader {
const Conditions* conditions,
const DeleteHandler& delete_handler,
const DelCondSatisfied delete_status,
+ Cache* lru_cache,
RuntimeState* runtime_state,
- OlapReaderStatistics* stats,
- Cache* lru_cache);
+ OlapReaderStatistics* stats);
~SegmentReader();
@@ -303,9 +303,6 @@ class SegmentReader {
DeleteHandler _delete_handler;
DelCondSatisfied _delete_status;
- RuntimeState* _runtime_state; // 用于统计内存消耗等运行时信息
- OlapReaderStatistics* _stats;
- Cache* _lru_cache;
bool _eof; // eof标志
@@ -364,6 +361,9 @@ class SegmentReader {
std::unique_ptr<MemPool> _mem_pool;
StorageByteBuffer* _shared_buffer;
+ Cache* _lru_cache;
+ RuntimeState* _runtime_state; // 用于统计内存消耗等运行时信息
+ OlapReaderStatistics* _stats;
// Set when seek_to_block is called, valid until next seek_to_block is
called.
bool _without_filter = false;
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 7b3aa1c7..f16ba161 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -1123,6 +1123,7 @@ bool SchemaChangeWithSorting::_internal_sorting(const
vector<RowBlock*>& row_blo
(*temp_segment_group) =
new(nothrow) SegmentGroup(_tablet->tablet_id(),
+ 0,
_tablet->tablet_schema(),
_tablet->num_key_fields(),
_tablet->num_short_key_fields(),
@@ -1772,6 +1773,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert(
SegmentGroup* new_segment_group = nullptr;
if ((*it)->transaction_id() == 0) {
new_segment_group = new SegmentGroup(dest_tablet->tablet_id(),
+ 0,
dest_tablet->tablet_schema(),
dest_tablet->num_key_fields(),
dest_tablet->num_short_key_fields(),
@@ -1783,6 +1785,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert(
(*it)->segment_group_id(), 0);
} else {
new_segment_group = new SegmentGroup(dest_tablet->tablet_id(),
+ 0,
dest_tablet->tablet_schema(),
dest_tablet->num_key_fields(),
dest_tablet->num_short_key_fields(),
@@ -2007,6 +2010,7 @@ OLAPStatus
SchemaChangeHandler::_alter_tablet(SchemaChangeParams* sc_params) {
// we create a new delta with the same version as the ColumnData
processing currently.
SegmentGroup* new_segment_group = new(nothrow) SegmentGroup(
sc_params->new_tablet->tablet_id(),
+ 0,
sc_params->new_tablet->tablet_schema(),
sc_params->new_tablet->num_key_fields(),
sc_params->new_tablet->num_short_key_fields(),
@@ -2371,7 +2375,7 @@ OLAPStatus SchemaChange::create_init_version(
}
// Create writer, which write nothing to tablet, to generate empty
data file
- writer = ColumnDataWriter::create(tablet, segment_group, false);
+ writer = ColumnDataWriter::create(segment_group, false,
tablet->compress_kind(), tablet->bloom_filter_fpp());
if (writer == NULL) {
LOG(WARNING) << "fail to create writer. [tablet=" <<
tablet->full_name() << "]";
res = OLAP_ERR_MALLOC_ERROR;
diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp
index 9934da4b..dd3d6950 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -254,6 +254,7 @@ OLAPStatus TabletManager::create_init_version(TTabletId
tablet_id, SchemaHash sc
}
new_segment_group = new(nothrow) SegmentGroup(tablet->tablet_id(),
+ 0,
tablet->tablet_schema(),
tablet->num_key_fields(),
tablet->num_short_key_fields(),
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]