Skip to content

Commit

Permalink
Merge branch 'main' into sm-pq-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotrashivam committed Mar 21, 2024
2 parents 9f7c55e + 94baae6 commit b62abb7
Show file tree
Hide file tree
Showing 249 changed files with 11,844 additions and 6,336 deletions.
403 changes: 0 additions & 403 deletions .github/workflows/docs-ci-v2.yml

This file was deleted.

105 changes: 77 additions & 28 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,52 @@ on:
branches: [ 'main', 'release/v*' ]

jobs:
makedirs:
runs-on: ubuntu-22.04
steps:
- name: Make Directories
run: |
mkdir -p tmp-deephaven-core-v2/${{ github.ref_name }}/
cd tmp-deephaven-core-v2/${{ github.ref_name }}/
mkdir -p javadoc pydoc client-api
cd client-api
mkdir -p javascript python cpp-examples cpp r
- name: Deploy Directories
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -rlptDvz
path: tmp-deephaven-core-v2/
remote_path: deephaven-core-v2/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}
symlink:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') }}
needs: [javadoc, typedoc, pydoc, cppdoc, rdoc]
runs-on: ubuntu-22.04
steps:
- name: Make Symlinks
run: |
mkdir -p tmp-deephaven-core-v2/symlinks
cd tmp-deephaven-core-v2/symlinks
ln -s ../${{ github.ref_name }} latest
ln -s ../main next
- name: Deploy Symlinks
uses: burnett01/rsync-deployments@5.2
with:
switches: -rlptDvz
path: tmp-deephaven-core-v2/
remote_path: deephaven-core-v2/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}
javadoc:
needs: [makedirs]
runs-on: ubuntu-22.04
concurrency:
group: javadoc-${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -51,25 +96,26 @@ jobs:
run: echo "version=$(cat build/version)" >> $GITHUB_OUTPUT

- name: Upload Javadocs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: javadocs-${{ steps.dhc-version.outputs.version }}
path: 'combined-javadoc/build/docs/javadoc/'

- name: Deploy Javadoc
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: combined-javadoc/build/docs/javadoc/
remote_path: deephaven-core/javadoc/
remote_path: deephaven-core-v2/${{ github.ref_name }}/javadoc/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}

typedoc:
needs: [makedirs]
runs-on: ubuntu-22.04
concurrency:
group: typedoc-${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -113,25 +159,26 @@ jobs:
run: echo "version=$(cat build/version)" >> $GITHUB_OUTPUT

- name: Upload JavaScript/TypeScript docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: typedoc-${{ steps.dhc-version.outputs.version }}
path: 'web/client-api/types/build/documentation/'

- name: Deploy JavaScript/TypeScript docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: web/client-api/types/build/documentation/
remote_path: deephaven-core/client-api/javascript/
remote_path: deephaven-core-v2/${{ github.ref_name }}/client-api/javascript/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}

pydoc:
needs: [makedirs]
runs-on: ubuntu-22.04
concurrency:
group: pydoc-${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -175,38 +222,38 @@ jobs:
run: echo "version=$(cat build/version)" >> $GITHUB_OUTPUT

- name: Upload Python Server Docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: pyserver-docs-${{ steps.dhc-version.outputs.version }}
path: 'sphinx/build/docs/'

- name: Upload Python Client Docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: pyclient-docs-${{ steps.dhc-version.outputs.version }}
path: 'sphinx/build/pyclient-docs/'

- name: Deploy Python Docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: sphinx/build/docs/
remote_path: deephaven-core/pydoc/
remote_path: deephaven-core-v2/${{ github.ref_name }}/pydoc/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}

- name: Deploy Client Python Docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: sphinx/build/pyclient-docs/
remote_path: deephaven-core/client-api/python/
remote_path: deephaven-core-v2/${{ github.ref_name }}/client-api/python/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
Expand All @@ -221,6 +268,7 @@ jobs:
if-no-files-found: ignore

cppdoc:
needs: [makedirs]
runs-on: ubuntu-22.04
concurrency:
group: cppdoc-${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -257,44 +305,45 @@ jobs:
run: echo "version=$(cat build/version)" >> $GITHUB_OUTPUT

- name: Upload Client C++ Docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: cppclient-docs-${{ steps.dhc-version.outputs.version }}
path: 'sphinx/build/cppClientDocs/'

- name: Upload Client C++ Example Docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: cppclient-examples-${{ steps.dhc-version.outputs.version }}
path: 'sphinx/build/cppExamplesDocs/'

- name: Deploy Client C++ Docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: sphinx/build/cppClientDocs/
remote_path: deephaven-core/client-api/cpp/
remote_path: deephaven-core-v2/${{ github.ref_name }}/client-api/cpp/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}

- name: Deploy Client C++ Example Docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: sphinx/build/cppExamplesDocs/
remote_path: deephaven-core/client-api/cpp-examples/
remote_path: deephaven-core-v2/${{ github.ref_name }}/client-api/cpp-examples/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
remote_key: ${{ secrets.DEEPHAVEN_CORE_SSH_KEY }}

rdoc:
needs: [makedirs]
runs-on: ubuntu-22.04
concurrency:
group: rdoc-${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -331,19 +380,19 @@ jobs:
run: echo "version=$(cat build/version)" >> $GITHUB_OUTPUT

- name: Upload R Docs
if: ${{ (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/v') }}
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: rdoc-${{ steps.dhc-version.outputs.version }}
path: 'R/rdeephaven/docs/'

- name: Deploy R Docs
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' }}
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
switches: -rlptDvz --delete
path: R/rdeephaven/docs/
remote_path: deephaven-core/client-api/r/
remote_path: deephaven-core-v2/${{ github.ref_name }}/client-api/r/
remote_host: ${{ secrets.DOCS_HOST }}
remote_port: ${{ secrets.DOCS_PORT }}
remote_user: ${{ secrets.DOCS_USER }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/quick-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,18 @@ jobs:
name: quick-ci-jvm-err
path: '**/*_pid*.log'
if-no-files-found: ignore

verify-python-min-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install vermin
run: pip install vermin==1.6.0

- name: Verify minimum version support
run: vermin -t=3.8 --no-tips --eval-annotations --violations py/server/deephaven py/client py/client-ticking py/embedded-server
50 changes: 27 additions & 23 deletions Util/src/main/java/io/deephaven/util/SafeCloseable.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,43 @@
*/
public interface SafeCloseable extends AutoCloseable {

@Override
void close();

/**
* {@link #close() Close} all non-{@code null} SafeCloseable arguments.
* {@link #close() Close} all non-{@code null} {@link AutoCloseable} arguments.
*
* @param safeCloseables SafeCloseables to {@link #close() close}
* @param autoCloseables {@link AutoCloseable AutoCloseables} to {@link #close() close}
*/
static void closeAll(@NotNull final SafeCloseable... safeCloseables) {
closeAll(Arrays.asList(safeCloseables).iterator());
static void closeAll(@NotNull final AutoCloseable... autoCloseables) {
closeAll(Arrays.asList(autoCloseables).iterator());
}

/**
* {@link #close() Close} all non-{@code null} SafeCloseable elements. Terminates the {@code stream}.
* {@link #close() Close} all non-{@code null} {@link AutoCloseable} elements. Terminates the {@code stream}.
*
* @param stream the stream of SafeCloseables to {@link #close() close}
* @param <SCT> the safe closable type
* @param stream The stream of {@link AutoCloseable AutoCloseables} to {@link #close() close}
* @param <ACT> the auto closable type
*/
static <SCT extends SafeCloseable> void closeAll(@NotNull final Stream<SCT> stream) {
static <ACT extends AutoCloseable> void closeAll(@NotNull final Stream<ACT> stream) {
closeAll(stream.iterator());
}

/**
* {@link #close() Close} all non-{@code null} SafeCloseable elements. Consumes the {@code iterator}.
* {@link #close() Close} all non-{@code null} {@link AutoCloseable} elements. Consumes the {@code iterator}.
*
* @param iterator the iterator of SafeCloseables to {@link #close() close}
* @param <SCT> the safe closable type
* @param iterator The iterator of {@link AutoCloseable AutoCloseables} to {@link #close() close}
* @param <ACT> the auto closable type
*/
static <SCT extends SafeCloseable> void closeAll(@NotNull final Iterator<SCT> iterator) {
static <ACT extends AutoCloseable> void closeAll(@NotNull final Iterator<ACT> iterator) {
List<Exception> exceptions = null;
while (iterator.hasNext()) {
final SafeCloseable safeCloseable = iterator.next();
if (safeCloseable == null) {
final AutoCloseable autoCloseable = iterator.next();
if (autoCloseable == null) {
continue;
}
try {
safeCloseable.close();
autoCloseable.close();
} catch (Exception e) {
if (exceptions == null) {
exceptions = new ArrayList<>();
Expand All @@ -67,16 +70,17 @@ static <SCT extends SafeCloseable> void closeAll(@NotNull final Iterator<SCT> it
}

/**
* {@link #close() Close} a single SafeCloseable argument if it is non-{@code null}.
* {@link #close() Close} a single {@link AutoCloseable} argument if it is non-{@code null}.
*
* @param safeCloseable The SafeCloseable to {@link #close() close}
* @param autoCloseable The {@link AutoCloseable} to {@link #close() close}
*/
static void closeIfNonNull(@Nullable final SafeCloseable safeCloseable) {
if (safeCloseable != null) {
safeCloseable.close();
static void closeIfNonNull(@Nullable final AutoCloseable autoCloseable) {
if (autoCloseable != null) {
try {
autoCloseable.close();
} catch (Exception e) {
throw new UncheckedDeephavenException("Exception while closing resource", e);
}
}
}

@Override
void close();
}
20 changes: 10 additions & 10 deletions Util/src/main/java/io/deephaven/util/SafeCloseableArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
import java.util.List;

/**
* {@link SafeCloseable} that will close non-null values inside of an array.
* {@link SafeCloseable} that will close non-null values inside an array.
* <p>
* The common use case is to create an array; use the SafeCloseableArray in an ignored try-with-resources variable, and
* then populate the array within the loop. If you fail before populating the array nothing is closed, if you fail
* during or after populating the array the created values are closed.
* then populate the array within the loop. If the operation fails before populating the array nothing is closed. If the
* operation fails during or after populating the array the populated values are closed.
*/
public class SafeCloseableArray<SCT extends SafeCloseable> implements SafeCloseable {
public class SafeCloseableArray<ACT extends AutoCloseable> implements SafeCloseable {

private final SCT[] array;
private final ACT[] array;

public SafeCloseableArray(SCT[] entries) {
public SafeCloseableArray(ACT[] entries) {
array = entries;
}

Expand All @@ -30,16 +30,16 @@ public final void close() {
}

/**
* Close an array of {@link SafeCloseable} entries, ignoring {@code null} elements and assigning elements to
* Close an array of {@link AutoCloseable} entries, ignoring {@code null} elements and assigning elements to
* {@code null} as they are cleared.
*
*
* @param array The array to operate one
*/
public static <SCT extends SafeCloseable> void close(@NotNull final SCT[] array) {
public static <ACT extends AutoCloseable> void close(final ACT @NotNull [] array) {
final int length = array.length;
List<Exception> exceptions = null;
for (int ii = 0; ii < length; ii++) {
try (final SafeCloseable ignored = array[ii]) {
try (final AutoCloseable ignored = array[ii]) {
array[ii] = null;
} catch (Exception e) {
if (exceptions == null) {
Expand Down
Loading

0 comments on commit b62abb7

Please sign in to comment.