Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed May 12, 2016
1 parent c4939cb commit 4233fa3
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 3 deletions.
Empty file removed src/config
Empty file.
1 change: 1 addition & 0 deletions src/terark/db/db_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class TERARK_DB_DLL DbContext : public DbContextLink {
valvec<byte> row2;
valvec<byte> key1;
valvec<byte> key2;
valvec<byte> userBuf; // TerarkDB will not use userBuf
valvec<uint32_t> offsets;
ColumnVec cols1;
ColumnVec cols2;
Expand Down
5 changes: 5 additions & 0 deletions src/terark/db/db_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ class TERARK_DB_DLL CommitException : public DbException {
using DbException::DbException;
};

class TERARK_DB_DLL NeedRetryException : public DbException {
public:
using DbException::DbException;
};

} } // namespace terark::db

#endif // __terark_db_db_store_hpp__
12 changes: 11 additions & 1 deletion src/terark/db/db_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,18 @@ CompositeTable::insertSyncIndex(llong subId, TransactionGuard& txn, DbContext* c
}

// dup keys in unique index errors will be ignored
llong CompositeTable::upsertRow(fstring row, DbContext* ctx) {
for (size_t retry = 0; retry < 2; ++retry) {
llong recId = doUpsertRow(row, ctx);
if (recId >= 0) {
return recId;
}
}
TERARK_THROW(NeedRetryException, "Insertion temporary failed, retry later");
}

llong
CompositeTable::upsertRow(fstring row, DbContext* ctx) {
CompositeTable::doUpsertRow(fstring row, DbContext* ctx) {
const SchemaConfig& sconf = *m_schema;
if (sconf.m_uniqIndices.size() > 1) {
THROW_STD(invalid_argument
Expand Down
2 changes: 2 additions & 0 deletions src/terark/db/db_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ class TERARK_DB_DLL CompositeTable : public ReadableStore {
bool updateWithSyncIndex(llong newSubId, fstring row, DbContext*);
void updateSyncMultIndex(llong newSubId, class TransactionGuard&, DbContext*);

llong doUpsertRow(fstring row, DbContext*);

boost::filesystem::path getMergePath(PathRef dir, size_t mergeSeq) const;
boost::filesystem::path getSegPath(const char* type, size_t segIdx) const;
boost::filesystem::path getSegPath2(PathRef dir, size_t mergeSeq, const char* type, size_t segIdx) const;
Expand Down
2 changes: 1 addition & 1 deletion vs2015/terark-db/db_bench_terark_index/data/dbmeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"CompressingWorkMemSize" : "10K",
"MaxWritingSegmentSize": "20K",
"TableClass" : "MockDbTable",
"//TableClass" : "MockDbTable",
"TableIndex" : [
{ "fields": "key", "ordered" : true, "unique": true }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>--benchmarks=readwhilewriting --value_size=128 --num=1000000 --reads=2000000 --sync_index=1 --threads=4 --db=data --read_ratio=70</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>--benchmarks=readwhilewriting --value_size=128 --num=100000 --reads=200000 --sync_index=1 --threads=4 --db=data --read_ratio=70</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerEnvironment>PATH=C:\osc\wiredtiger-2.7.0;C:\osc\tbb\build\vs2010\intel64\Debug-MT;</LocalDebuggerEnvironment>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions vs2015/terark-db/terark-db/terark-db.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\terark\db\appendonly.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_dll_decl.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_index.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_store.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_conf.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_context.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_segment.hpp" />
<ClInclude Include="..\..\..\src\terark\db\db_table.hpp" />
<ClInclude Include="..\..\..\src\terark\db\delete_on_close_file_lock.hpp" />
<ClInclude Include="..\..\..\src\terark\db\dfadb\dfadb_segment.hpp" />
<ClInclude Include="..\..\..\src\terark\db\dfadb\dfadb_table.hpp" />
<ClInclude Include="..\..\..\src\terark\db\dfadb\nlt_index.hpp" />
Expand All @@ -187,6 +189,7 @@
<ClInclude Include="..\..\..\src\terark\db\intkey_index.hpp" />
<ClInclude Include="..\..\..\src\terark\db\json.hpp" />
<ClInclude Include="..\..\..\src\terark\db\mock_db_engine.hpp" />
<ClInclude Include="..\..\..\src\terark\db\rocksdb-api.hpp" />
<ClInclude Include="..\..\..\src\terark\db\wiredtiger\wt_db_context.hpp" />
<ClInclude Include="..\..\..\src\terark\db\wiredtiger\wt_db_segment.hpp" />
<ClInclude Include="..\..\..\src\terark\db\zip_int_store.hpp" />
Expand All @@ -207,6 +210,7 @@
<ClCompile Include="..\..\..\src\terark\db\db_context.cpp" />
<ClCompile Include="..\..\..\src\terark\db\db_segment.cpp" />
<ClCompile Include="..\..\..\src\terark\db\db_table.cpp" />
<ClCompile Include="..\..\..\src\terark\db\delete_on_close_file_lock.cpp" />
<ClCompile Include="..\..\..\src\terark\db\dfadb\dfadb_segment.cpp" />
<ClCompile Include="..\..\..\src\terark\db\dfadb\dfadb_table.cpp" />
<ClCompile Include="..\..\..\src\terark\db\dfadb\nlt_index.cpp" />
Expand Down
12 changes: 12 additions & 0 deletions vs2015/terark-db/terark-db/terark-db.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@
<ClInclude Include="..\..\..\src\terark\db\appendonly.hpp">
<Filter>Header Files\terark\db</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\terark\db\db_dll_decl.hpp">
<Filter>Header Files\terark\db</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\terark\db\delete_on_close_file_lock.hpp">
<Filter>Header Files\terark\db</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\terark\db\rocksdb-api.hpp">
<Filter>Header Files\terark\db</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
Expand Down Expand Up @@ -197,5 +206,8 @@
<ClCompile Include="..\..\..\src\terark\db\appendonly.cpp">
<Filter>Source Files\terark\db</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\terark\db\delete_on_close_file_lock.cpp">
<Filter>Source Files\terark\db</Filter>
</ClCompile>
</ItemGroup>
</Project>

0 comments on commit 4233fa3

Please sign in to comment.