23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/javadoc/legal/ASSEMBLY_EXCEPTION:
--------------------------------------------------------------------------------
1 |
2 | OPENJDK ASSEMBLY EXCEPTION
3 |
4 | The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
5 | openjdk.org ("OpenJDK Code") is distributed under the terms of the GNU
6 | General Public License version 2
7 | only ("GPL2"), with the following clarification and special exception.
8 |
9 | Linking this OpenJDK Code statically or dynamically with other code
10 | is making a combined work based on this library. Thus, the terms
11 | and conditions of GPL2 cover the whole combination.
12 |
13 | As a special exception, Oracle gives you permission to link this
14 | OpenJDK Code with certain code licensed by Oracle as indicated at
15 | https://openjdk.org/legal/exception-modules-2007-05-08.html
16 | ("Designated Exception Modules") to produce an executable,
17 | regardless of the license terms of the Designated Exception Modules,
18 | and to copy and distribute the resulting executable under GPL2,
19 | provided that the Designated Exception Modules continue to be
20 | governed by the licenses under which they were offered by Oracle.
21 |
22 | As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
23 | to build an executable that includes those portions of necessary code that
24 | Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
25 | with the Classpath exception). If you modify or add to the OpenJDK code,
26 | that new GPL2 code may still be combined with Designated Exception Modules
27 | if the new code is made subject to this exception by its copyright holder.
28 |
--------------------------------------------------------------------------------
/docs/javadoc/legal/jquery.md:
--------------------------------------------------------------------------------
1 | ## jQuery v3.7.1
2 |
3 | ### jQuery License
4 | ```
5 | jQuery v 3.7.1
6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the
10 | "Software"), to deal in the Software without restriction, including
11 | without limitation the rights to use, copy, modify, merge, publish,
12 | distribute, sublicense, and/or sell copies of the Software, and to
13 | permit persons to whom the Software is furnished to do so, subject to
14 | the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be
17 | included in all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/javadoc/module-search-index.js:
--------------------------------------------------------------------------------
1 | moduleSearchIndex = [{"l":"org.cojen.tupl"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/javadoc/package-search-index.js:
--------------------------------------------------------------------------------
1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"m":"org.cojen.tupl","l":"org.cojen.tupl"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.diag"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.ext"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.io"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.repl"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.tools"},{"m":"org.cojen.tupl","l":"org.cojen.tupl.util"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/copy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Bold.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Bold.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-BoldOblique.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-BoldOblique.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-BoldOblique.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-BoldOblique.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Oblique.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Oblique.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Oblique.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans-Oblique.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSans.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSans.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Bold.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Bold.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-BoldOblique.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-BoldOblique.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-BoldOblique.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-BoldOblique.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Oblique.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Oblique.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Oblique.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono-Oblique.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSansMono.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Bold.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Bold.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-BoldItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-BoldItalic.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-BoldItalic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-BoldItalic.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Italic.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif-Italic.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif.woff
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/fonts/DejaVuLGCSerif.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/fonts/DejaVuLGCSerif.woff2
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/glass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/glass.png
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/link.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
14 |
--------------------------------------------------------------------------------
/docs/javadoc/resource-files/x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/javadoc/resource-files/x.png
--------------------------------------------------------------------------------
/docs/javadoc/tag-search-index.js:
--------------------------------------------------------------------------------
1 | tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"},{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/optane-tupl-perf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/optane-tupl-perf.png
--------------------------------------------------------------------------------
/docs/optane-v120.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/optane-v120.ods
--------------------------------------------------------------------------------
/docs/optane-v248.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/optane-v248.ods
--------------------------------------------------------------------------------
/docs/optane-v500.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/optane-v500.ods
--------------------------------------------------------------------------------
/docs/random-counters.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/random-counters.ods
--------------------------------------------------------------------------------
/docs/update-then-insert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cojen/TuplDB/7a817f1f515bd27910df191745c18fde8b516893/docs/update-then-insert.png
--------------------------------------------------------------------------------
/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * See {@link org.cojen.tupl.Database} to get started with TuplDB.
4 | */
5 | module org.cojen.tupl {
6 | exports org.cojen.tupl;
7 | exports org.cojen.tupl.diag;
8 | exports org.cojen.tupl.ext;
9 | exports org.cojen.tupl.io;
10 | exports org.cojen.tupl.repl;
11 | exports org.cojen.tupl.tools;
12 | exports org.cojen.tupl.util;
13 |
14 | requires org.cojen.maker;
15 | requires org.cojen.dirmi;
16 |
17 | requires static java.sql;
18 |
19 | // Could be transitive because it's part of the public API, but only in EventListener.
20 | // I doubt that the java.logging module is used much.
21 | requires static java.logging;
22 |
23 | requires static java.management;
24 |
25 | requires static org.lz4.java;
26 |
27 | requires static org.slf4j;
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/CacheExhaustedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when the database cache is full and no more data can be loaded into
22 | * it. Can be caused by too many active cursors, transactions or open indexes.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class CacheExhaustedException extends DatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public CacheExhaustedException() {
30 | }
31 |
32 | public CacheExhaustedException(String message) {
33 | super(message);
34 | }
35 |
36 | @Override
37 | public boolean isRecoverable() {
38 | return true;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/ClosedIndexException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to access or modify the contents of an index through a closed
22 | * reference.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class ClosedIndexException extends DatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public ClosedIndexException() {
30 | }
31 |
32 | @Override
33 | public boolean isRecoverable() {
34 | return true;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/ColumnProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2024 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Represents an operation which accepts a column name and value.
22 | *
23 | * @author Brian S. O'Neill
24 | * @see Table#forEach
25 | */
26 | @FunctionalInterface
27 | public interface ColumnProcessor {
28 | /**
29 | * Performs this operation on the given arguments.
30 | *
31 | * @param row the row the column belongs to
32 | * @param name column name
33 | * @param value column value
34 | */
35 | void accept(R row, String name, Object value);
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/ConfirmationFailureException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when replication cannot be confirmed.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class ConfirmationFailureException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public ConfirmationFailureException() {
29 | }
30 |
31 | public ConfirmationFailureException(String message) {
32 | super(message);
33 | }
34 |
35 | public ConfirmationFailureException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | public ConfirmationFailureException(String message, Throwable cause) {
40 | super(message, cause);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/ConfirmationInterruptedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when replication confirmation was interrupted by another thread.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class ConfirmationInterruptedException extends ConfirmationFailureException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public ConfirmationInterruptedException() {
29 | super();
30 | }
31 |
32 | @Override
33 | public boolean isRecoverable() {
34 | return true;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/CorruptDatabaseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when the internal structure of the {@link Database database} is
22 | * corrupt.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class CorruptDatabaseException extends DatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public CorruptDatabaseException() {
30 | }
31 |
32 | public CorruptDatabaseException(String message) {
33 | super(message);
34 | }
35 |
36 | public CorruptDatabaseException(Throwable cause) {
37 | super(cause);
38 | }
39 |
40 | public CorruptDatabaseException(String message, Throwable cause) {
41 | super(message, cause);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/DatabaseFullException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when database is full and no more data can be stored into it.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class DatabaseFullException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public DatabaseFullException() {
29 | }
30 |
31 | public DatabaseFullException(Throwable cause) {
32 | super(cause);
33 | }
34 |
35 | public DatabaseFullException(String message, Throwable cause) {
36 | super(message, cause);
37 | }
38 |
39 | public DatabaseFullException(String message) {
40 | super(message);
41 | }
42 |
43 | @Override
44 | public boolean isRecoverable() {
45 | return true;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/DeletedIndexException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to access or modify the contents of an index which was deleted.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class DeletedIndexException extends ClosedIndexException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public DeletedIndexException() {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/Hidden.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | import java.lang.annotation.*;
21 |
22 | /**
23 | * Annotation which hides a column from a row's generated {@code toString} method.
24 | *
25 | * @author Brian S O'Neill
26 | * @see Table
27 | */
28 | @Documented
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target({ElementType.METHOD})
31 | public @interface Hidden {
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/IllegalUpgradeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to acquire an upgradable or exclusive lock when a
22 | * shared lock is already held. Use {@link LockMode#UPGRADABLE_READ
23 | * UPGRADABLE_READ} mode to prevent this.
24 | *
25 | * @author Brian S O'Neill
26 | * @see Transaction#lockMode Transaction.lockMode
27 | * @see LockResult#ILLEGAL
28 | * @see LockUpgradeRule
29 | */
30 | public class IllegalUpgradeException extends LockFailureException {
31 | private static final long serialVersionUID = 1L;
32 |
33 | public IllegalUpgradeException() {
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/IncompleteRestoreException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when opening a database which wasn't completely {@linkplain
22 | * Database#restoreFromSnapshot restored}.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class IncompleteRestoreException extends CorruptDatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public IncompleteRestoreException() {
30 | }
31 |
32 | public IncompleteRestoreException(String message) {
33 | super(message);
34 | }
35 |
36 | public IncompleteRestoreException(Throwable cause) {
37 | super(cause);
38 | }
39 |
40 | public IncompleteRestoreException(String message, Throwable cause) {
41 | super(message, cause);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/InvalidTransactionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when acting upon a broken transaction instance.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class InvalidTransactionException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public InvalidTransactionException() {
29 | }
30 |
31 | public InvalidTransactionException(String message) {
32 | super(message);
33 | }
34 |
35 | public InvalidTransactionException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | public InvalidTransactionException(String message, Throwable cause) {
40 | super(message, cause);
41 | }
42 |
43 | @Override
44 | public boolean isRecoverable() {
45 | return true;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/LockFailureException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when a lock request by a {@linkplain Transaction transaction} failed.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class LockFailureException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public LockFailureException() {
29 | }
30 |
31 | public LockFailureException(String message) {
32 | super(message);
33 | }
34 |
35 | public LockFailureException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | public LockFailureException(String message, Throwable cause) {
40 | super(message, cause);
41 | }
42 |
43 | @Override
44 | public boolean isRecoverable() {
45 | return true;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/LockInterruptedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when a lock request by a {@linkplain Transaction transaction} was
22 | * interrupted by another thread.
23 | *
24 | * @author Brian S O'Neill
25 | * @see LockResult#INTERRUPTED
26 | */
27 | public class LockInterruptedException extends LockFailureException {
28 | private static final long serialVersionUID = 1L;
29 |
30 | public LockInterruptedException() {
31 | super();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/NoSuchRowException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to read or write against a nonexistent row which was expected to
22 | * exist.
23 | *
24 | * @author Brian S. O'Neill
25 | */
26 | public class NoSuchRowException extends DatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public NoSuchRowException() {
30 | }
31 |
32 | public NoSuchRowException(String message) {
33 | super(message);
34 | }
35 |
36 | @Override
37 | public boolean isRecoverable() {
38 | return true;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/NoSuchValueException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when reading from an accessor {@linkplain ValueAccessor#newValueInputStream stream},
22 | * for a value which doesn't exist.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class NoSuchValueException extends DatabaseException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public NoSuchValueException() {
30 | super();
31 | }
32 |
33 | @Override
34 | public boolean isRecoverable() {
35 | return true;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/Nullable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | import java.lang.annotation.*;
21 |
22 | /**
23 | * Annotation which indicates that a column value can be null.
24 | *
25 | * @author Brian S O'Neill
26 | * @see Table
27 | */
28 | @Documented
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target({ElementType.METHOD})
31 | public @interface Nullable {
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/Ordering.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Describes entry ordering in {@linkplain View views} and {@linkplain Cursor cursors}.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public enum Ordering {
26 | ASCENDING, DESCENDING, UNSPECIFIED;
27 |
28 | public Ordering reverse() {
29 | Ordering ordering = this;
30 | if (ordering != UNSPECIFIED) {
31 | if (ordering == ASCENDING) {
32 | ordering = DESCENDING;
33 | } else {
34 | ordering = ASCENDING;
35 | }
36 | }
37 | return ordering;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/SchemaChangeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to alter a {@link PrimaryKey primary key}, an {@link AlternateKey
22 | * alternate key}, or a {@link SecondaryIndex secondary index}.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class SchemaChangeException extends IllegalStateException {
27 | public SchemaChangeException(String message) {
28 | super(message);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/UniqueConstraintException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when a row store operation would create a conflicting key.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class UniqueConstraintException extends ViewConstraintException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public UniqueConstraintException() {
29 | }
30 |
31 | public UniqueConstraintException(String message) {
32 | super(message);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/UnmodifiableReplicaException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to make changes to a read-only replica.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class UnmodifiableReplicaException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public UnmodifiableReplicaException() {
29 | }
30 |
31 | @Override
32 | public boolean isRecoverable() {
33 | return true;
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/UnmodifiableViewException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to make a change to an index or view which doesn't
22 | * permit modifications.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | public class UnmodifiableViewException extends ViewConstraintException {
27 | private static final long serialVersionUID = 2L;
28 |
29 | public UnmodifiableViewException() {
30 | }
31 |
32 | @Override
33 | public boolean isRecoverable() {
34 | return true;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/UnpositionedCursorException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Exception thrown when acting on a {@link Cursor} which doesn't have a position defined.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class UnpositionedCursorException extends IllegalStateException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public UnpositionedCursorException() {
29 | }
30 |
31 | public UnpositionedCursorException(String message) {
32 | super(message);
33 | }
34 |
35 | public UnpositionedCursorException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | public UnpositionedCursorException(String message, Throwable cause) {
40 | super(message, cause);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/UnsetColumnException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to read a row column which doesn't have anything assigned to it.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class UnsetColumnException extends IllegalStateException {
26 | public UnsetColumnException(String name) {
27 | super(name);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/Unsigned.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | import java.lang.annotation.*;
21 |
22 | /**
23 | * Annotation which indicates that a primitive column type be treated as an unsigned type. This
24 | * affects the natural ordering of the column and its presentation by the row's {@code
25 | * toString} method.
26 | *
27 | * @author Brian S O'Neill
28 | * @see Table
29 | */
30 | @Documented
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Target({ElementType.METHOD})
33 | public @interface Unsigned {
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/Untransformed.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | import java.lang.annotation.*;
21 |
22 | /**
23 | * Annotation which indicates that an inverse mapping function doesn't transform the value. A
24 | * function which transforms the value can still be annotated as untransformed if the transform
25 | * is guaranteed to lose no information or if it doesn't change the natural comparison order.
26 | *
27 | * @author Brian S. O'Neill
28 | * @see Mapper
29 | * @see Grouper.Factory
30 | */
31 | @Documented
32 | @Retention(RetentionPolicy.RUNTIME)
33 | @Target({ElementType.METHOD})
34 | public @interface Untransformed {
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/ViewConstraintException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl;
19 |
20 | /**
21 | * Thrown when attempting to perform an illegal view alteration.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | public class ViewConstraintException extends DatabaseException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public ViewConstraintException() {
29 | }
30 |
31 | public ViewConstraintException(String message) {
32 | super(message);
33 | }
34 |
35 | @Override
36 | public boolean isRecoverable() {
37 | return true;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/Chain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | /**
21 | * Simple linked list iterator. Is used by {@link BTreeSeparator} and {@link BTreeMerger},
22 | * which in turn are used by {@link ParallelSorter}.
23 | *
24 | * @author Brian S O'Neill
25 | */
26 | interface Chain {
27 | /**
28 | * Returns the current chain node element.
29 | */
30 | E element();
31 |
32 | /**
33 | * Returns the next chain node, or null if none left.
34 | */
35 | Chain next();
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/CoreTransaction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.io.IOException;
21 |
22 | import org.cojen.tupl.Transaction;
23 |
24 | /**
25 | *
26 | *
27 | * @author Brian S O'Neill
28 | */
29 | interface CoreTransaction extends Transaction {
30 | public void redoPredicateMode() throws IOException;
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/DatabaseAccess.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | /**
21 | * Interface for an object that can access a LocalDatabase instance.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | interface DatabaseAccess {
26 | LocalDatabase getDatabase();
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/DetachedDeadlockInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import org.cojen.tupl.diag.DeadlockInfo;
21 |
22 | /**
23 | *
24 | *
25 | * @author Brian S O'Neill
26 | */
27 | public record DetachedDeadlockInfo(String desc, Object ownerAttachment) implements DeadlockInfo {
28 | private static final long serialVersionUID = 1L;
29 |
30 | @Override
31 | public Object row() {
32 | return null;
33 | }
34 |
35 | @Override
36 | public long indexId() {
37 | return 0;
38 | }
39 |
40 | @Override
41 | public byte[] indexName() {
42 | return null;
43 | }
44 |
45 | @Override
46 | public byte[] key() {
47 | return null;
48 | }
49 |
50 | @Override
51 | public String toString() {
52 | if (ownerAttachment == null) {
53 | return desc;
54 | }
55 | return desc + "; attachment: " + ownerAttachment;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/EntryPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.lang.invoke.MethodHandle;
21 |
22 | import org.cojen.tupl.Entry;
23 |
24 | import org.cojen.tupl.table.RowMaker;
25 |
26 | /**
27 | * Singleton Entry populator use by the SortScanner class.
28 | *
29 | * @author Brian S O'Neill
30 | */
31 | public final class EntryPopulator {
32 | /**
33 | * Given an entry, sets the key and value, returning the original entry or a new one if
34 | * given null.
35 | *
36 | * Entry populate(Entry e, byte[] key, byte[] value);
37 | */
38 | public static final MethodHandle THE = RowMaker.makePopulator(Entry.class);
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/HandlerWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import org.cojen.tupl.ext.Handler;
21 |
22 | /**
23 | *
24 | *
25 | * @author Brian S O'Neill
26 | */
27 | abstract class HandlerWriter implements Handler {
28 | final LocalDatabase mDatabase;
29 | final int mHandlerId;
30 | final H mRecoveryHandler;
31 |
32 | HandlerWriter(LocalDatabase db, int handlerId, H recoveryHandler) {
33 | mDatabase = db;
34 | mHandlerId = handlerId;
35 | mRecoveryHandler = recoveryHandler;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/IntegerRef.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | /**
21 | * Interface which makes it possible to pass an int around by reference.
22 | *
23 | * @author Brian S O'Neill
24 | */
25 | interface IntegerRef {
26 | public int get();
27 |
28 | public void set(int v);
29 |
30 | /**
31 | * Mutable alternative to java.lang.Integer.
32 | */
33 | public static class Value implements IntegerRef {
34 | public int value;
35 |
36 | public int get() {
37 | return value;
38 | }
39 |
40 | public void set(int v) {
41 | value = v;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/RedoListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import org.cojen.tupl.Index;
21 | import org.cojen.tupl.Transaction;
22 |
23 | /**
24 | * A listener of incoming replication operations
25 | *
26 | * @author Brian S O'Neill
27 | * @see LocalDatabase#addRedoListener
28 | */
29 | public interface RedoListener {
30 | /**
31 | * Is invoked after a store operation has been applied, but before the transaction has
32 | * committed. Any exception thrown by this method is logged as an uncaught exception.
33 | *
34 | * @param txn transaction that includes the store operation, using NO_REDO mode
35 | * @param ix the index that was stored into
36 | * @param key the stored key
37 | * @param value the stored value, which is null for a delete
38 | */
39 | void store(Transaction txn, Index ix, byte[] key, byte[] value);
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/ScanVisitor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.io.IOException;
21 |
22 | import org.cojen.tupl.Index;
23 |
24 | /**
25 | *
26 | *
27 | * @author Brian S O'Neill
28 | */
29 | @FunctionalInterface
30 | public interface ScanVisitor {
31 | /**
32 | * @return false if should stop
33 | */
34 | boolean apply(Index tree) throws IOException;
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/ShutdownHook.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.lang.ref.WeakReference;
21 |
22 | /**
23 | * Shutdown operation registered with {@link Checkpointer}.
24 | *
25 | * @author Brian S O'Neill
26 | */
27 | interface ShutdownHook {
28 | void shutdown();
29 |
30 | /**
31 | * ShutdownHook must not maintain a strong reference to the LocalDatabase.
32 | */
33 | static abstract class Weak extends WeakReference implements ShutdownHook {
34 | Weak(A obj) {
35 | super(obj);
36 | }
37 |
38 | @Override
39 | public final void shutdown() {
40 | A obj = get();
41 | if (obj != null) {
42 | doShutdown(obj);
43 | clear();
44 | }
45 | }
46 |
47 | abstract void doShutdown(A obj);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/SortReverseScanner.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.io.IOException;
21 |
22 | import java.util.Comparator;
23 |
24 | import org.cojen.tupl.Entry;
25 |
26 | /**
27 | * Overrides inherited methods to scan in reverse order.
28 | *
29 | * @author Brian S O'Neill
30 | */
31 | class SortReverseScanner extends SortScanner {
32 | SortReverseScanner(LocalDatabase db) {
33 | super(db);
34 | }
35 |
36 | @Override
37 | public Comparator getComparator() {
38 | return super.getComparator().reversed();
39 | }
40 |
41 | @Override
42 | protected void doStep(BTreeCursor c) throws IOException {
43 | c.deletePrevious();
44 | }
45 |
46 | @Override
47 | protected void initPosition(BTreeCursor c) throws IOException {
48 | c.last();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/org/cojen/tupl/core/TreeRef.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Cojen.org
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | package org.cojen.tupl.core;
19 |
20 | import java.lang.ref.ReferenceQueue;
21 | import java.lang.ref.WeakReference;
22 |
23 | /**
24 | * Allows open Trees to be unloaded when no longer in use.
25 | *
26 | * @author Brian S O'Neill
27 | */
28 | final class TreeRef extends WeakReference {
29 | final long mId;
30 | final byte[] mName;
31 | final Node mRoot;
32 |
33 | /**
34 | * @param tree referenced tree
35 | * @param btree access to internal state; can be same as tree param
36 | */
37 | TreeRef(Tree tree, BTree btree, ReferenceQueue