Skip to content

Commit 941eb47

Browse files
authored
Feature - create_compute() (#9)
* Create Compute Method * Amend Create Compute with Logic * Remove Packaging Docs * Logic Compute Methods * Cleanup Repo with Mock HTTP Client * Use IHTTPClient for Jobs
1 parent a2acce3 commit 941eb47

28 files changed

+975
-1182
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Makefile
3434
*.cmake
3535
!CMakeLists.txt
3636
!cmake/*.cmake.in
37-
!packaging/**/portfile.cmake
3837

3938
# Testing
4039
Testing/

README.md

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
A C++ SDK for Databricks, providing an interface for interacting with Databricks services.
88

9-
**Latest Release**: [v0.2.1](https://github.com/calvinjmin/databricks-sdk-cpp/releases/tag/v0.2.1)
9+
**Latest Release**: [v0.2.2](https://github.com/calvinjmin/databricks-sdk-cpp/releases/tag/v0.2.2)
1010

1111
**Author**: Calvin Min ([email protected])
1212

@@ -457,7 +457,7 @@ std::cout << "Connected to: " << auth.host << std::endl;
457457
std::cout << "Using warehouse: " << sql.http_path << std::endl;
458458
```
459459

460-
For a complete example, see `examples/basic/modular_config_example.cpp`.
460+
For a complete example, see `examples/simple_query.cpp`.
461461

462462
## Running Examples
463463

@@ -493,58 +493,23 @@ set -a; source .env; set +a
493493

494494
### Run Examples
495495

496-
After building with `BUILD_EXAMPLES=ON`, examples are organized by feature:
496+
After building with `BUILD_EXAMPLES=ON`, the following examples are available:
497497

498-
### Basic Examples
499498
```bash
500-
# Simple SQL query
501-
./examples/simple_query
499+
# SQL query execution with parameterized queries
500+
./build/examples/simple_query
502501

503502
# Jobs API - list jobs, get details, trigger runs
504-
./examples/jobs_example
505-
```
506-
507-
### Connection Pooling Examples
508-
```bash
509-
# Transparent connection pooling
510-
./examples/transparent_pooling
511-
512-
# Benchmark pooling performance (measure actual speedup)
513-
./examples/benchmark [num_queries]
514-
```
515-
516-
### Async Examples
517-
```bash
518-
# Async operations
519-
./examples/async_operations
520-
521-
# Combined pool + async (best performance)
522-
./examples/pool_async_combined
523-
```
524-
525-
### Testing Pooling Performance
526-
527-
To measure the actual performance improvement from connection pooling:
528-
529-
```bash
530-
cd build
531-
./examples/benchmark 10
532-
```
503+
./build/examples/jobs_example
533504

534-
This runs 10 queries with and without pooling, showing:
535-
- Total time comparison
536-
- Per-query time breakdown
537-
- Speedup factor (typically 2-10x faster)
538-
- Connection overhead estimation
539-
540-
Example output:
505+
# Compute API - manage clusters, create/start/stop/terminate
506+
./build/examples/compute_example
541507
```
542-
Without pooling: 5234ms total
543-
With pooling: 892ms total
544508

545-
Time saved: 4342ms (83.0% faster)
546-
Speedup: 5.87x
547-
```
509+
Each example demonstrates a different aspect of the SDK:
510+
- **simple_query**: Basic SQL execution and parameterized queries
511+
- **jobs_example**: Jobs API for workflow automation
512+
- **compute_example**: Compute/Clusters API for cluster management
548513

549514
## Performance Considerations
550515

@@ -629,7 +594,7 @@ int main() {
629594
- Timestamps returned as Unix milliseconds (`uint64_t`)
630595
- Automatic error handling with descriptive messages
631596

632-
For a complete example, see `examples/basic/jobs_example.cpp`.
597+
For a complete example, see `examples/jobs_example.cpp`.
633598

634599
### Compute/Clusters API
635600

dev-docs/README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22

33
This directory contains documentation for maintainers and contributors of the Databricks C++ SDK.
44

5-
## Contents
6-
7-
### 📦 [VCPKG_SUBMISSION.md](VCPKG_SUBMISSION.md)
8-
Complete guide for publishing the SDK to the vcpkg package registry. Includes:
9-
- Step-by-step submission process
10-
- Testing procedures
11-
- Versioning and updates
12-
- Troubleshooting common issues
13-
14-
**Audience**: Package maintainers publishing to vcpkg
15-
16-
### 📦 [Packaging Files](../packaging/)
17-
Distribution and packaging files have been moved to the `packaging/` directory at the project root. This includes:
18-
- `packaging/vcpkg-port/` - vcpkg registry port files
19-
- Future: Conan, Homebrew, and other package manager configs
20-
21-
**See**: [packaging/README.md](../packaging/README.md) for details
22-
235
## For End Users
246

257
If you're looking to **use** the SDK (not develop/maintain it), see the main [README.md](../README.md) for:

examples/CMakeLists.txt

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,22 @@
1-
# Example applications organized by feature
1+
# Example applications demonstrating SDK features
22

3-
# ========== Basic Examples ==========
4-
add_executable(simple_query basic/simple_query.cpp)
3+
# ========== SQL Examples ==========
4+
add_executable(simple_query simple_query.cpp)
55
target_link_libraries(simple_query PRIVATE databricks_sdk)
66

7-
add_executable(secure_query basic/secure_query.cpp)
8-
target_link_libraries(secure_query PRIVATE databricks_sdk)
9-
10-
add_executable(modular_config_example basic/modular_config_example.cpp)
11-
target_link_libraries(modular_config_example PRIVATE databricks_sdk)
12-
13-
add_executable(jobs_example basic/jobs_example.cpp)
7+
# ========== Jobs API Examples ==========
8+
add_executable(jobs_example jobs_example.cpp)
149
target_link_libraries(jobs_example PRIVATE databricks_sdk)
1510

16-
# ========== Connection Pooling Examples ==========
17-
add_executable(transparent_pooling pooling/transparent_pooling.cpp)
18-
target_link_libraries(transparent_pooling PRIVATE databricks_sdk)
19-
20-
add_executable(benchmark pooling/benchmark.cpp)
21-
target_link_libraries(benchmark PRIVATE databricks_sdk)
22-
23-
# ========== Async Examples ==========
24-
add_executable(async_operations async/async_operations.cpp)
25-
target_link_libraries(async_operations PRIVATE databricks_sdk)
26-
27-
add_executable(pool_async_combined async/pool_async_combined.cpp)
28-
target_link_libraries(pool_async_combined PRIVATE databricks_sdk)
11+
# ========== Compute API Examples ==========
12+
add_executable(compute_example compute_example.cpp)
13+
target_link_libraries(compute_example PRIVATE databricks_sdk)
2914

3015
# Set RPATH for all examples to find ODBC libraries
3116
set_target_properties(
3217
simple_query
33-
secure_query
34-
modular_config_example
35-
transparent_pooling
36-
benchmark
37-
async_operations
38-
pool_async_combined
3918
jobs_example
19+
compute_example
4020
PROPERTIES
4121
BUILD_RPATH "${CMAKE_BINARY_DIR};/opt/homebrew/lib;/usr/local/lib"
4222
INSTALL_RPATH "/opt/homebrew/lib;/usr/local/lib"

examples/async/async_operations.cpp

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)