Skip to content

Commit 2baf339

Browse files
committed
Merge branch 'release/0.9.0'
2 parents 90aabaa + 3b2e579 commit 2baf339

26 files changed

+3537
-2979
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ xcuserdata
4141
# Carthage/Checkouts
4242

4343
Carthage/Build
44+
45+
# CocoaPods Lint
46+
rocksdb_src

.travis.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode8.3
2+
osx_image: xcode9
33

44
branches:
55
except:
@@ -15,21 +15,18 @@ env:
1515
- WORKSPACE=ObjectiveRocks.xcworkspace
1616
- IOS_FRAMEWORK_SCHEME=ObjectiveRocks-iOS
1717
- MACOS_FRAMEWORK_SCHEME=ObjectiveRocks
18-
- IOS_SDK=iphonesimulator10.3
19-
- MACOS_SDK=macosx10.12
18+
- IOS_SDK=iphonesimulator11.0
19+
- MACOS_SDK=macosx10.13
2020
matrix:
21-
- DESTINATION="arch=x86_64" SIMULATOR="" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
22-
- DESTINATION="OS=9.0,name=iPhone 6" SIMULATOR="iPhone 6 (9.0)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
23-
- DESTINATION="OS=9.1,name=iPhone 6 Plus" SIMULATOR="iPhone 6 Plus (9.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
24-
- DESTINATION="OS=9.2,name=iPhone 6S" SIMULATOR="iPhone 6S (9.2)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
25-
- DESTINATION="OS=9.3,name=iPhone 6S Plus" SIMULATOR="iPhone 6S Plus (9.3)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
26-
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SIMULATOR="iPhone 7 Plus (10.3.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
21+
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
22+
- DESTINATION="OS=9.3,name=iPhone 6s Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
23+
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
24+
- DESTINATION="OS=11.0,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
2725

2826
script:
2927
- set -o pipefail
3028
- xcodebuild -version
3129
- xcodebuild -showsdks
32-
- SIMULATOR_ID=$(xcrun instruments -s devices | grep -io "$SIMULATOR \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
33-
- open -b com.apple.iphonesimulator --args -CurrentDeviceUDID $SIMULATOR_ID
3430
- travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build | xcpretty -c
3531
- travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c;
32+
- travis_wait 30 pod lib lint --skip-import-validation --allow-warnings --verbose

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Change Log
22

3+
## [0.9.0](https://github.com/iabudiab/ObjectiveRocks/releases/tag/0.9.0)
4+
5+
Released on 2017.05.25
6+
7+
- RocksDB Version: `5.13.1`: [facebook/rocksdb@c60df9d](https://github.com/facebook/rocksdb/commit/c60df9d9e7629fe208a9b848293a5599f83d5e77)
8+
9+
### Added
10+
11+
- CocoaPods integration
12+
- Spec & Scripts by @rob-keepsafe in #9
13+
14+
- RocksDB `isClosed` method to check if the database instance is still open.
15+
- Added by @rob-keepsafe in #11
16+
17+
### Updated
18+
19+
- Project settings to Xcode9
20+
- Tests to Swift4 syntax
21+
22+
323
## [0.8.0](https://github.com/iabudiab/ObjectiveRocks/releases/tag/0.8.0)
424

525
Released on 2017.07.13

Code/ObjectiveRocks.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,80 @@ extern const unsigned char ObjectiveRocksVersionString[];
1414

1515
#import <TargetConditionals.h>
1616

17+
// Rocks
1718
#import "RocksDB.h"
19+
#import "RocksDBRange.h"
1820

21+
// Column Family
1922
#import "RocksDBColumnFamily.h"
2023
#import "RocksDBColumnFamilyDescriptor.h"
2124

25+
// Iterator
2226
#import "RocksDBIterator.h"
2327
#import "RocksDBPrefixExtractor.h"
2428

29+
// Write Batch
2530
#import "RocksDBWriteBatch.h"
2631

32+
// Comparator
2733
#import "RocksDBComparator.h"
2834

35+
// Options
2936
#import "RocksDBOptions.h"
3037
#import "RocksDBDatabaseOptions.h"
3138
#import "RocksDBColumnFamilyOptions.h"
3239
#import "RocksDBWriteOptions.h"
3340
#import "RocksDBReadOptions.h"
41+
#import "RocksDBCompactRangeOptions.h"
42+
43+
// Env
44+
#import "RocksDBEnv.h"
45+
46+
// Table
3447
#import "RocksDBTableFactory.h"
3548
#import "RocksDBBlockBasedTableOptions.h"
3649
#import "RocksDBCache.h"
3750
#import "RocksDBFilterPolicy.h"
51+
52+
// Memtable
3853
#import "RocksDBMemTableRepFactory.h"
39-
#import "RocksDBEnv.h"
4054

55+
// Snapshot
4156
#import "RocksDBSnapshot.h"
57+
#import "RocksDBSnapshotUnavailable.h"
4258

59+
// Merge Operator
4360
#import "RocksDBMergeOperator.h"
4461

62+
//// OSX Only
4563
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
4664

65+
// Column Family
4766
#import "RocksDBColumnFamilyMetadata.h"
4867

68+
// Write Batch
69+
#import "RocksDBIndexedWriteBatch.h"
70+
#import "RocksDBWriteBatchIterator.h"
71+
72+
// Env
73+
#import "RocksDBThreadStatus.h"
74+
75+
// Table
4976
#import "RocksDBPlainTableOptions.h"
5077
#import "RocksDBCuckooTableOptions.h"
5178

52-
#import "RocksDBThreadStatus.h"
79+
// Properties
80+
#import "RocksDBProperties.h"
5381

82+
// Snapshot
5483
#import "RocksDBCheckpoint.h"
5584

85+
// Statistics
5686
#import "RocksDBStatistics.h"
5787
#import "RocksDBStatisticsHistogram.h"
5888

89+
// Backup
5990
#import "RocksDBBackupEngine.h"
6091
#import "RocksDBBackupInfo.h"
6192

62-
#import "RocksDBProperties.h"
63-
6493
#endif

Code/RocksDB.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ NS_ASSUME_NONNULL_BEGIN
146146
/** @brief Closes the database instance */
147147
- (void)close;
148148

149+
/** @brief Whether or not the database instance is closed */
150+
- (BOOL)isClosed;
151+
149152
/**
150153
Sets the default read & write options for all database operations.
151154
@@ -273,8 +276,6 @@ NS_ASSUME_NONNULL_BEGIN
273276
/**
274277
Stores the given key-object pair into the DB.
275278
276-
@discussion
277-
278279
@param anObject The object for key.
279280
@param aKey The key for object.
280281
@param error If an error occurs, upon return contains an `NSError` object that describes the problem.

Code/RocksDB.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ - (void)close
178178
}
179179
}
180180

181+
- (BOOL)isClosed {
182+
@synchronized(self) {
183+
return _db == nullptr;
184+
}
185+
}
186+
181187
#pragma mark - Open
182188

183189
- (BOOL)openDatabaseReadOnly:(BOOL)readOnly

Code/RocksDBBackupEngine.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ - (instancetype)initWithPath:(NSString *)path
4545
if (self) {
4646
_path = [path copy];
4747
rocksdb::Status status = rocksdb::BackupEngine::Open(rocksdb::Env::Default(),
48-
rocksdb::BackupableDBOptions::BackupableDBOptions(_path.UTF8String),
48+
rocksdb::BackupableDBOptions(_path.UTF8String),
4949
&_backupEngine);
5050
if (!status.ok()) {
5151
NSLog(@"Error opening database backup: %@", [RocksDBError errorWithRocksStatus:status]);

Code/RocksDBDatabaseOptions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#import <Foundation/Foundation.h>
1010

1111
@class RocksDBEnv;
12+
13+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
1214
@class RocksDBStatistics;
15+
#endif
1316

1417
NS_ASSUME_NONNULL_BEGIN
1518

@@ -60,13 +63,15 @@ typedef NS_ENUM(unsigned char, RocksDBLogLevel)
6063
The default is 0. */
6164
@property (nonatomic, assign) uint64_t maxWriteAheadLogSize;
6265

66+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
6367
/** @brief If non-nil, metrics about database operations will be collected.
6468
Statistics objects should not be shared between DB instances.
6569
The default is nil.
6670
6771
@see RocksDBStatistics
6872
*/
6973
@property (nonatomic, strong, nullable) RocksDBStatistics *statistics;
74+
#endif
7075

7176
/** @brief If true, then every store to stable storage will issue a fsync.
7277
The default is false. */

Code/RocksDBDatabaseOptions.mm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
#import "RocksDBDatabaseOptions.h"
1010

1111
#import "RocksDBEnv.h"
12-
#import "RocksDBStatistics.h"
13-
1412
#import <rocksdb/options.h>
1513

14+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
15+
#import "RocksDBStatistics.h"
1616
@interface RocksDBStatistics ()
1717
@property (nonatomic, assign) std::shared_ptr<rocksdb::Statistics> statistics;
1818
@end
19+
#endif
1920

2021
@interface RocksDBDatabaseOptions ()
2122
{
2223
rocksdb::DBOptions _options;
2324

25+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
2426
RocksDBStatistics *_statisticsWrapper;
27+
#endif
2528
}
2629
@property (nonatomic, assign) const rocksdb::DBOptions options;
2730
@end
@@ -112,6 +115,7 @@ - (void)setMaxWriteAheadLogSize:(uint64_t)maxWriteAheadLogSize
112115
_options.max_total_wal_size = maxWriteAheadLogSize;
113116
}
114117

118+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
115119
- (RocksDBStatistics *)statistics
116120
{
117121
return _statisticsWrapper;
@@ -122,6 +126,7 @@ - (void)setStatistics:(RocksDBStatistics *)statistics
122126
_statisticsWrapper = statistics;
123127
_options.statistics = _statisticsWrapper.statistics;
124128
}
129+
#endif
125130

126131
- (BOOL)useFSync
127132
{

Code/RocksDBOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ NS_ASSUME_NONNULL_BEGIN
7777
The default is 0. */
7878
@property (nonatomic, assign) uint64_t maxWriteAheadLogSize;
7979

80+
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
8081
/** @brief If non-nil, metrics about database operations will be collected.
8182
Statistics objects should not be shared between DB instances.
8283
The default is nil.
8384
8485
@see RocksDBStatistics
8586
*/
8687
@property (nonatomic, strong, nullable) RocksDBStatistics *statistics;
88+
#endif
8789

8890
/** @brief If true, then the contents of manifest and data files are not
8991
synced to stable storage.

0 commit comments

Comments
 (0)