Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit d589e94

Browse files
authored
fix readme (#685)
1 parent 5f307f7 commit d589e94

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

storage/rest/service-sparkjava/README.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ sparkjava# Storage Viewer HowTo:
55
- [Usage](#2-usage)
66
- [Example](#3-example)
77
- [Routes](#4-available-routes)
8-
- [typeDictionary](#4-1-typedictionary)
9-
- [object](#4-2-object)
10-
- [root](#4-3-root)
11-
- [filesStatistics](#4-4-filesstatistics)
8+
- [typeDictionary](#41-typedictionary)
9+
- [object](#42-object)
10+
- [root](#43-root)
11+
- [filesStatistics](#44-filesstatistics)
1212
- [Configuration](#5-configuration)
13-
- [Server](#5-1-server)
14-
- [URL](#5-1-1-url-root)
15-
- [port](#5-1-2-port)
16-
- [Logging](#5-2-logging)
13+
- [Server](#51-server)
14+
- [URL](#511-url-root)
15+
- [port](#512-port)
16+
- [Logging](#52-logging)
1717

1818
## 1. Setup:
1919

2020
### Maven Dependencies
21-
```
21+
```xml
2222
<dependency>
2323
<groupId>one.microstream</groupId>
2424
<artifactId>microstream-storage-restservice-sparkjava</artifactId>
@@ -34,7 +34,7 @@ one.microstream.storage.restservice.types.StorageRestService
3434
## 2. Usage
3535

3636
### 2.1. Start the Microstream storage as usual:
37-
```
37+
```java
3838
EmbeddedStorageManager storage = EmbeddedStorage
3939
.Foundation(storageDir)
4040
.start();
@@ -44,19 +44,19 @@ EmbeddedStorageManager storage = EmbeddedStorage
4444
- Start the server
4545
By default the server will listen on port 4567
4646

47-
```
47+
```java
4848
final StorageRestService service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class);
4949
service.start();
5050
```
5151

5252
### 2.3 Stoping the viewer server
53-
```
53+
```java
5454
service.stop();
5555
```
5656
the EmbeddedStorageManager will not be stopped.
5757

5858
## 3. Example
59-
```
59+
```java
6060
public class MainTestStorageRestService
6161
{
6262
public static void main(final String[] args)
@@ -81,7 +81,7 @@ public class MainTestStorageRestService
8181
/[InstanceName]/ dictionary
8282
Get the typeDictionary as String
8383
```
84-
http://localhost:4567/microstream/dictionary"
84+
http://localhost:4567/microstream/dictionary
8585
```
8686

8787
### 4.2 Object
@@ -134,15 +134,15 @@ optional, default is default is java.lang.Long.MAX_VALUE \
134134
limit the number of returned resolved references to supplied count.\
135135
requires “references=true”
136136

137-
### 4.3. Root
138-
/[InstanceName]/root
137+
### 4.3. Root
138+
`/[InstanceName]/root`
139139
Get Name and object ID of the current storage root element
140140
```
141141
http://localhost:4567/microstream/root
142142
```
143143

144144
### 4.4. FilesStatistics
145-
/[InstanceName]/maintenance/filesStatistics
145+
`/[InstanceName]/maintenance/filesStatistics`
146146
Get some statistics about the used storage files
147147
```
148148
http://localhost:4567/microstream/maintenance/filesStatistics
@@ -154,37 +154,35 @@ The Storage viewer uses the Spark micro framework from http://sparkjava.com/ as
154154

155155
To provide a custom configured server just create an Spark.service and initialize the StorageRestService with this Spark.service
156156

157-
```
157+
```java
158158
final Service service = Service.ignite().port(port);
159159
final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class);
160160
service.setSparkService(sparkService);
161161
service.start();
162162
```
163163

164164
#### 5.1.1 Url Root
165-
To set an other url root then 'microstream' use the constructor:
165+
To set another url root then 'microstream' use the constructor:
166166

167-
```
167+
```java
168168
final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class);
169169
service.setInstanceName(storageName);
170170
service.start();
171-
172171
```
173172

174173
#### 5.1.2 Port
175-
To set an other port then the default port 4567 it is required to provide a custom configured Spark Server session to the StorageRestService constructor:
174+
To set another port then the default port 4567 it is required to provide a custom configured Spark Server session to the StorageRestService constructor:
176175

177-
```
176+
```java
178177
final Service service = Service.ignite().port(port);
179178
final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class);
180179
service.setSparkService(sparkService);
181180
service.start();
182-
183181
```
184182

185183
### 5.2 Logging
186184
To enable logging add the following dependency to the project:
187-
```
185+
```xml
188186
<dependency>
189187
<groupId>org.slf4j</groupId>
190188
<artifactId>slf4j-simple</artifactId>

0 commit comments

Comments
 (0)