You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability to import schema defined in JSON format via file path or directly via JSON string.
This implementation doesn't migrate or update already defined schema elements. Neither it removes existing defined elements.
SchemaInitStrategy is defined in mind to be able to implement migration and more advance schema management, even so current JSON schema importer implementation is fairly simple. This work is made in hopes to simplify schema definition for beginners, speed-up prototypes development based on JanusGraph, and simplify testing.
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
Copy file name to clipboardExpand all lines: docs/changelog.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,15 +105,14 @@ For more information on features and bug fixes in 1.1.0, see the GitHub mileston
105
105
Inlining vertex properties into a Composite Index structure can offer significant performance and efficiency benefits.
106
106
See [documentation](./schema/index-management/index-performance.md#inlining-vertex-properties-into-a-composite-index) on how to inline vertex properties into a composite index.
107
107
108
-
**Important Notes on Compatibility**
109
-
110
-
1.**Backward Incompatibility**
111
-
Once a JanusGraph instance adopts this new schema feature, it cannot be rolled back to a prior version of JanusGraph.
112
-
The changes in the schema structure are not compatible with earlier versions of the system.
113
-
114
-
2.**Migration Considerations**
115
-
It is critical that users carefully plan their migration to this new version, as there is no automated or manual rollback process
116
-
to revert to an older version of JanusGraph once this feature is used.
108
+
!!! warning
109
+
Important Notes on Compatibility.
110
+
1. Backward Incompatibility:
111
+
Once a JanusGraph instance adopts this new schema feature, it cannot be rolled back to a prior version of JanusGraph.
112
+
The changes in the schema structure are not compatible with earlier versions of the system.
113
+
2. Migration Considerations:
114
+
It is critical that users carefully plan their migration to this new version, as there is no automated or manual rollback process
115
+
to revert to an older version of JanusGraph once this feature is used.
117
116
118
117
##### BerkeleyJE ability to overwrite arbitrary settings applied at `EnvironmentConfig` creation
119
118
@@ -124,6 +123,11 @@ All configurations values should be specified as `String` and be formated the sa
Copy file name to clipboardExpand all lines: docs/configs/janusgraph-cfg.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -384,6 +384,29 @@ Schema related configuration options
384
384
| schema.default | Configures the DefaultSchemaMaker to be used by this graph. Either one of the following shorthands can be used: <br> - `default` (a blueprints compatible schema maker with MULTI edge labels and SINGLE property keys),<br> - `tp3` (same as default, but has LIST property keys),<br> - `none` (automatic schema creation is disabled)<br> - `ignore-prop` (same as none, but simply ignore unknown properties rather than throw exceptions)<br> - or to the full package and classname of a custom/third-party implementing the interface `org.janusgraph.core.schema.DefaultSchemaMaker`| String | default | MASKABLE |
385
385
| schema.logging | Controls whether logging is enabled for schema makers. This only takes effect if you set `schema.default` to `default` or `ignore-prop`. For `default` schema maker, warning messages will be logged before schema types are created automatically. For `ignore-prop` schema maker, warning messages will be logged before unknown properties are ignored. | Boolean | false | MASKABLE |
386
386
387
+
### schema.init
388
+
Configuration options for schema initialization on startup.
389
+
390
+
391
+
| Name | Description | Datatype | Default Value | Mutability |
392
+
| ---- | ---- | ---- | ---- | ---- |
393
+
| schema.init.drop-before-startup | Drops the entire schema with graph data before JanusGraph schema initialization. Note that the schema will be dropped regardless of the selected initialization strategy, including when `schema.init.strategy` is set to `none`. | Boolean | false | LOCAL |
394
+
| schema.init.strategy | Specifies the strategy for schema initialization before starting JanusGraph. You must provide the full class path of a class that implements the `SchemaInitStrategy` interface and has parameterless constructor.<br>The following shortcuts are also available:<br>- `none` - Skips schema initialization.<br>- `json` - Schema initialization via provided JSON file or JSON string.<br> | String | none | LOCAL |
395
+
396
+
### schema.init.json
397
+
Options for JSON schema initialization strategy.
398
+
399
+
400
+
| Name | Description | Datatype | Default Value | Mutability |
401
+
| ---- | ---- | ---- | ---- | ---- |
402
+
| schema.init.json.await-index-status-timeout | Timeout for awaiting index status operation defined in milliseconds. If the status await timeouts the exception will be thrown during schema initialization process. | Long | 180000 | LOCAL |
403
+
| schema.init.json.file | File path to JSON formated schema definition. | String | (no default value) | LOCAL |
404
+
| schema.init.json.force-close-other-instances | Force closes other JanusGraph instances before schema initialization, regardless if they are active or not. This is a dangerous operation. This option exists to help people initialize schema who struggle with zombie JanusGraph instances. It's not recommended to be used unless you know what you are doing. Instead of this parameter, it's recommended to check `graph.unique-instance-id` and `graph.replace-instance-if-exists` options to not create zombie instances in the cluster. | Boolean | false | LOCAL |
405
+
| schema.init.json.indices-activation | Indices activation type:<br>- `reindex_and_enable_updated_only` - Reindex process will be triggered for any updated index. After this all updated indexes will be enabled.<br>- `reindex_and_enable_non_enabled` - Reindex process will be triggered for any index which is not enabled (including previously created indices). After reindexing all indices will be enabled.<br>- `skip_activation` - Skip reindex process for any updated indexes.<br>- `force_enable_updated_only` - Force enable all updated indexes without running any reindex process (previous data may not be available for such indices).<br>- `force_enable_non_enabled` - Force enable all indexes (including previously created indices) without running any reindex process (previous data may not be available for such indices).<br> | String | reindex_and_enable_non_enabled | LOCAL |
406
+
| schema.init.json.skip-elements | Skip creation of VertexLabel, EdgeLabel, and PropertyKey. | Boolean | false | LOCAL |
407
+
| schema.init.json.skip-indices | Skip creation of indices. | Boolean | false | LOCAL |
408
+
| schema.init.json.string | JSON formated schema definition string. This option takes precedence if both `file` and `string` are used. | String | (no default value) | LOCAL |
409
+
387
410
### storage
388
411
Configuration options for the storage backend. Some options are applicable only for certain backends.
0 commit comments