Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iabudiab committed May 24, 2018
2 parents 90aabaa + 3b2e579 commit 2baf339
Show file tree
Hide file tree
Showing 26 changed files with 3,537 additions and 2,979 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ xcuserdata
# Carthage/Checkouts

Carthage/Build

# CocoaPods Lint
rocksdb_src
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.3
osx_image: xcode9

branches:
except:
Expand All @@ -15,21 +15,18 @@ env:
- WORKSPACE=ObjectiveRocks.xcworkspace
- IOS_FRAMEWORK_SCHEME=ObjectiveRocks-iOS
- MACOS_FRAMEWORK_SCHEME=ObjectiveRocks
- IOS_SDK=iphonesimulator10.3
- MACOS_SDK=macosx10.12
- IOS_SDK=iphonesimulator11.0
- MACOS_SDK=macosx10.13
matrix:
- DESTINATION="arch=x86_64" SIMULATOR="" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
- DESTINATION="OS=9.0,name=iPhone 6" SIMULATOR="iPhone 6 (9.0)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=9.1,name=iPhone 6 Plus" SIMULATOR="iPhone 6 Plus (9.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=9.2,name=iPhone 6S" SIMULATOR="iPhone 6S (9.2)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=9.3,name=iPhone 6S Plus" SIMULATOR="iPhone 6S Plus (9.3)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SIMULATOR="iPhone 7 Plus (10.3.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
- DESTINATION="OS=9.3,name=iPhone 6s Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=11.0,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"

script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks
- SIMULATOR_ID=$(xcrun instruments -s devices | grep -io "$SIMULATOR \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
- open -b com.apple.iphonesimulator --args -CurrentDeviceUDID $SIMULATOR_ID
- travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build | xcpretty -c
- travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c;
- travis_wait 30 pod lib lint --skip-import-validation --allow-warnings --verbose
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change Log

## [0.9.0](https://github.com/iabudiab/ObjectiveRocks/releases/tag/0.9.0)

Released on 2017.05.25

- RocksDB Version: `5.13.1`: [facebook/rocksdb@c60df9d](https://github.com/facebook/rocksdb/commit/c60df9d9e7629fe208a9b848293a5599f83d5e77)

### Added

- CocoaPods integration
- Spec & Scripts by @rob-keepsafe in #9

- RocksDB `isClosed` method to check if the database instance is still open.
- Added by @rob-keepsafe in #11

### Updated

- Project settings to Xcode9
- Tests to Swift4 syntax


## [0.8.0](https://github.com/iabudiab/ObjectiveRocks/releases/tag/0.8.0)

Released on 2017.07.13
Expand Down
37 changes: 33 additions & 4 deletions Code/ObjectiveRocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,80 @@ extern const unsigned char ObjectiveRocksVersionString[];

#import <TargetConditionals.h>

// Rocks
#import "RocksDB.h"
#import "RocksDBRange.h"

// Column Family
#import "RocksDBColumnFamily.h"
#import "RocksDBColumnFamilyDescriptor.h"

// Iterator
#import "RocksDBIterator.h"
#import "RocksDBPrefixExtractor.h"

// Write Batch
#import "RocksDBWriteBatch.h"

// Comparator
#import "RocksDBComparator.h"

// Options
#import "RocksDBOptions.h"
#import "RocksDBDatabaseOptions.h"
#import "RocksDBColumnFamilyOptions.h"
#import "RocksDBWriteOptions.h"
#import "RocksDBReadOptions.h"
#import "RocksDBCompactRangeOptions.h"

// Env
#import "RocksDBEnv.h"

// Table
#import "RocksDBTableFactory.h"
#import "RocksDBBlockBasedTableOptions.h"
#import "RocksDBCache.h"
#import "RocksDBFilterPolicy.h"

// Memtable
#import "RocksDBMemTableRepFactory.h"
#import "RocksDBEnv.h"

// Snapshot
#import "RocksDBSnapshot.h"
#import "RocksDBSnapshotUnavailable.h"

// Merge Operator
#import "RocksDBMergeOperator.h"

//// OSX Only
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))

// Column Family
#import "RocksDBColumnFamilyMetadata.h"

// Write Batch
#import "RocksDBIndexedWriteBatch.h"
#import "RocksDBWriteBatchIterator.h"

// Env
#import "RocksDBThreadStatus.h"

// Table
#import "RocksDBPlainTableOptions.h"
#import "RocksDBCuckooTableOptions.h"

#import "RocksDBThreadStatus.h"
// Properties
#import "RocksDBProperties.h"

// Snapshot
#import "RocksDBCheckpoint.h"

// Statistics
#import "RocksDBStatistics.h"
#import "RocksDBStatisticsHistogram.h"

// Backup
#import "RocksDBBackupEngine.h"
#import "RocksDBBackupInfo.h"

#import "RocksDBProperties.h"

#endif
5 changes: 3 additions & 2 deletions Code/RocksDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ NS_ASSUME_NONNULL_BEGIN
/** @brief Closes the database instance */
- (void)close;

/** @brief Whether or not the database instance is closed */
- (BOOL)isClosed;

/**
Sets the default read & write options for all database operations.
Expand Down Expand Up @@ -273,8 +276,6 @@ NS_ASSUME_NONNULL_BEGIN
/**
Stores the given key-object pair into the DB.
@discussion
@param anObject The object for key.
@param aKey The key for object.
@param error If an error occurs, upon return contains an `NSError` object that describes the problem.
Expand Down
6 changes: 6 additions & 0 deletions Code/RocksDB.mm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ - (void)close
}
}

- (BOOL)isClosed {
@synchronized(self) {
return _db == nullptr;
}
}

#pragma mark - Open

- (BOOL)openDatabaseReadOnly:(BOOL)readOnly
Expand Down
2 changes: 1 addition & 1 deletion Code/RocksDBBackupEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (instancetype)initWithPath:(NSString *)path
if (self) {
_path = [path copy];
rocksdb::Status status = rocksdb::BackupEngine::Open(rocksdb::Env::Default(),
rocksdb::BackupableDBOptions::BackupableDBOptions(_path.UTF8String),
rocksdb::BackupableDBOptions(_path.UTF8String),
&_backupEngine);
if (!status.ok()) {
NSLog(@"Error opening database backup: %@", [RocksDBError errorWithRocksStatus:status]);
Expand Down
5 changes: 5 additions & 0 deletions Code/RocksDBDatabaseOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#import <Foundation/Foundation.h>

@class RocksDBEnv;

#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
@class RocksDBStatistics;
#endif

NS_ASSUME_NONNULL_BEGIN

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

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

/** @brief If true, then every store to stable storage will issue a fsync.
The default is false. */
Expand Down
9 changes: 7 additions & 2 deletions Code/RocksDBDatabaseOptions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@
#import "RocksDBDatabaseOptions.h"

#import "RocksDBEnv.h"
#import "RocksDBStatistics.h"

#import <rocksdb/options.h>

#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
#import "RocksDBStatistics.h"
@interface RocksDBStatistics ()
@property (nonatomic, assign) std::shared_ptr<rocksdb::Statistics> statistics;
@end
#endif

@interface RocksDBDatabaseOptions ()
{
rocksdb::DBOptions _options;

#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
RocksDBStatistics *_statisticsWrapper;
#endif
}
@property (nonatomic, assign) const rocksdb::DBOptions options;
@end
Expand Down Expand Up @@ -112,6 +115,7 @@ - (void)setMaxWriteAheadLogSize:(uint64_t)maxWriteAheadLogSize
_options.max_total_wal_size = maxWriteAheadLogSize;
}

#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
- (RocksDBStatistics *)statistics
{
return _statisticsWrapper;
Expand All @@ -122,6 +126,7 @@ - (void)setStatistics:(RocksDBStatistics *)statistics
_statisticsWrapper = statistics;
_options.statistics = _statisticsWrapper.statistics;
}
#endif

- (BOOL)useFSync
{
Expand Down
2 changes: 2 additions & 0 deletions Code/RocksDBOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ NS_ASSUME_NONNULL_BEGIN
The default is 0. */
@property (nonatomic, assign) uint64_t maxWriteAheadLogSize;

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

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

0 comments on commit 2baf339

Please sign in to comment.