Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 8c656b7

Browse files
authored
Merge pull request #1138 from pervazea/cleanup
Small code cleanups
2 parents 0ad9bf3 + 3438f07 commit 8c656b7

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

src/common/init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void PelotonInit::Initialize() {
3636
LOGGING_THREAD_COUNT = 1;
3737
GC_THREAD_COUNT = 1;
3838
EPOCH_THREAD_COUNT = 1;
39-
MAX_CONCURRENCY = 10;
4039

4140
// set max thread number.
4241
thread_pool.Initialize(0, CONNECTION_THREAD_COUNT + 3);

src/common/internal_types.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ size_t CONNECTION_THREAD_COUNT = 1;
3737
size_t LOGGING_THREAD_COUNT = 1;
3838
size_t GC_THREAD_COUNT = 1;
3939
size_t EPOCH_THREAD_COUNT = 1;
40-
size_t MAX_CONCURRENCY = 10;
4140

4241
//===--------------------------------------------------------------------===//
4342
// DatePart <--> String Utilities

src/include/catalog/abstract_catalog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AbstractCatalog {
8181
//===--------------------------------------------------------------------===//
8282

8383
// Maximum column name size for catalog schemas
84-
static const size_t max_name_size = 32;
84+
static const size_t max_name_size = 64;
8585

8686
// Local oid (without catalog type mask) starts from START_OID + OID_OFFSET
8787
std::atomic<oid_t> oid_ = ATOMIC_VAR_INIT(START_OID + OID_OFFSET);

src/include/common/internal_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,6 @@ extern size_t CONNECTION_THREAD_COUNT;
11601160
extern size_t LOGGING_THREAD_COUNT;
11611161
extern size_t GC_THREAD_COUNT;
11621162
extern size_t EPOCH_THREAD_COUNT;
1163-
extern size_t MAX_CONCURRENCY;
11641163

11651164
//===--------------------------------------------------------------------===//
11661165
// TupleMetadata

src/network/peloton_server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void PelotonServer::SSLInit() {
120120
// load trusted CA certificates (peer authentication)
121121
if (SSL_CTX_load_verify_locations(ssl_context, certificate_file_.c_str(),
122122
nullptr) != 1) {
123-
LOG_ERROR("Exception when loading root_crt!");
123+
LOG_WARN("Exception when loading root_crt!");
124124
SetSSLLevel(SSLLevel::SSL_PREFER);
125125
}
126126
// load OpenSSL's default CA certificate location
@@ -133,7 +133,7 @@ void PelotonServer::SSLInit() {
133133
if (SSL_CTX_use_certificate_chain_file(ssl_context,
134134
certificate_file_.c_str()) != 1) {
135135
SSL_CTX_free(ssl_context);
136-
LOG_ERROR("Exception when loading server certificate!");
136+
LOG_WARN("Exception when loading server certificate!");
137137
ssl_context = nullptr;
138138
SetSSLLevel(SSLLevel::SSL_DISABLE);
139139
return;

src/storage/data_table.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ ItemPointer DataTable::InsertTuple(const storage::Tuple *tuple,
350350

351351
bool DataTable::InsertTuple(const AbstractTuple *tuple,
352352
ItemPointer location, concurrency::TransactionContext *transaction,
353-
ItemPointer **index_entry_ptr, UNUSED_ATTRIBUTE bool check_fk) {
353+
ItemPointer **index_entry_ptr, bool check_fk) {
354354
if (CheckConstraints(tuple) == false) {
355355
LOG_TRACE("InsertTuple(): Constraint violated");
356356
return false;
@@ -591,7 +591,7 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
591591
storage::Tuple *new_tuple,
592592
concurrency::TransactionContext *current_txn,
593593
executor::ExecutorContext *context,
594-
bool is_update UNUSED_ATTRIBUTE)
594+
bool is_update)
595595
{
596596
size_t fk_count = GetForeignKeySrcCount();
597597

@@ -739,6 +739,8 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
739739
return true;
740740
}
741741

742+
// PA - looks like the FIXME has been done. We check to see if the key
743+
// is visible
742744
/**
743745
* @brief Check if all the foreign key constraints on this table
744746
* is satisfied by checking whether the key exist in the referred table
@@ -753,8 +755,8 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
753755
* @returns True on success, false if any foreign key constraints fail
754756
*/
755757
bool DataTable::CheckForeignKeyConstraints(
756-
const AbstractTuple *tuple UNUSED_ATTRIBUTE,
757-
concurrency::TransactionContext *transaction UNUSED_ATTRIBUTE) {
758+
const AbstractTuple *tuple,
759+
concurrency::TransactionContext *transaction) {
758760
for (auto foreign_key : foreign_keys_) {
759761
oid_t sink_table_id = foreign_key->GetSinkTableOid();
760762
storage::DataTable *ref_table = nullptr;
@@ -774,7 +776,6 @@ bool DataTable::CheckForeignKeyConstraints(
774776

775777
// The foreign key constraints only refer to the primary key
776778
if (index->GetIndexType() == IndexConstraintType::PRIMARY_KEY) {
777-
778779
std::vector<oid_t> key_attrs = foreign_key->GetSinkColumnIds();
779780
std::unique_ptr<catalog::Schema> foreign_key_schema(
780781
catalog::Schema::CopySchema(ref_table->schema, key_attrs));
@@ -783,11 +784,10 @@ bool DataTable::CheckForeignKeyConstraints(
783784
key->SetFromTuple(tuple, foreign_key->GetSourceColumnIds(), index->GetPool());
784785

785786
LOG_TRACE("check key: %s", key->GetInfo().c_str());
786-
787787
std::vector<ItemPointer *> location_ptrs;
788788
index->ScanKey(key.get(), location_ptrs);
789789

790-
// if this key doesn't exist in the refered column
790+
// if this key doesn't exist in the referred column
791791
if (location_ptrs.size() == 0) {
792792
LOG_DEBUG("The key: %s does not exist in table %s\n",
793793
key->GetInfo().c_str(),

src/storage/temp_table.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ ItemPointer TempTable::InsertTuple(
8080

8181
return (location);
8282
}
83+
8384
ItemPointer TempTable::InsertTuple(const Tuple *tuple) {
8485
return (this->InsertTuple(tuple, nullptr, nullptr));
8586
}

0 commit comments

Comments
 (0)