Skip to content

Commit d922e9c

Browse files
Merge branch '1.7.2'
2 parents fa8cb56 + 0e74814 commit d922e9c

File tree

55 files changed

+605
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+605
-440
lines changed

build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<property environment="env"/>
66
<property name="vendor" value="Orient Technologies Ltd"/>
77
<property name="product" value="OrientDB"/>
8-
<property name="version" value="1.7.1"/>
8+
<property name="version" value="1.7.2"/>
99
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
1010
else="../releases/orientdb-community-${version}">
1111
<isset property="releaseHome"/>

client/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>com.orientechnologies</groupId>
2626
<artifactId>orientdb-parent</artifactId>
27-
<version>1.7.1</version>
27+
<version>1.7.2</version>
2828
<relativePath>../</relativePath>
2929
</parent>
3030

client/src/main/java/com/orientechnologies/orient/client/remote/OEngineRemote.java

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public OEngineRemote() {
3636
}
3737

3838
public OStorage createStorage(final String iURL, final Map<String, String> iConfiguration) {
39-
OGlobalConfiguration.SECURITY_MAX_CACHED_ROLES.setValue(0);
40-
OGlobalConfiguration.SECURITY_MAX_CACHED_USERS.setValue(0);
41-
4239
try {
4340
synchronized (sharedStorages) {
4441
OStorageRemote sharedStorage = sharedStorages.get(iURL);

client/src/main/java/com/orientechnologies/orient/client/remote/OSBTreeBonsaiRemote.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ private List<Map.Entry<K, V>> fetchEntriesMajor(K key, boolean inclusive) {
152152
client.writeBytes(keyStream);
153153
client.writeBoolean(inclusive);
154154

155+
if (client.getSrvProtocolVersion() >= 21)
156+
client.writeInt(128);
157+
155158
storage.endRequest(client);
156159

157160
storage.beginResponse(client);
@@ -253,27 +256,27 @@ public OBinarySerializer<V> getValueSerializer() {
253256
return valueSerializer;
254257
}
255258

256-
class TreeEntry<K, V> implements Map.Entry<K, V> {
257-
private final K key;
258-
private final V value;
259+
class TreeEntry<EK, EV> implements Map.Entry<EK, EV> {
260+
private final EK key;
261+
private final EV value;
259262

260-
TreeEntry(K key, V value) {
263+
TreeEntry(EK key, EV value) {
261264
this.key = key;
262265
this.value = value;
263266
}
264267

265268
@Override
266-
public K getKey() {
269+
public EK getKey() {
267270
return key;
268271
}
269272

270273
@Override
271-
public V getValue() {
274+
public EV getValue() {
272275
return value;
273276
}
274277

275278
@Override
276-
public V setValue(V value) {
279+
public EV setValue(EV value) {
277280
throw new UnsupportedOperationException();
278281
}
279282
}

client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import com.orientechnologies.orient.core.storage.OStorageAbstract;
5959
import com.orientechnologies.orient.core.storage.OStorageOperationResult;
6060
import com.orientechnologies.orient.core.storage.OStorageProxy;
61+
import com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment;
6162
import com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext;
6263
import com.orientechnologies.orient.core.tx.OTransaction;
6364
import com.orientechnologies.orient.core.tx.OTransactionAbstract;
@@ -176,8 +177,10 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
176177
// POST OPEN
177178
openRemoteDatabase();
178179

179-
configuration = new OStorageConfiguration(this);
180-
configuration.load();
180+
final OStorageConfiguration storageConfiguration = new OStorageConfiguration(this);
181+
storageConfiguration.load();
182+
183+
configuration = storageConfiguration;
181184

182185
componentsFactory = new OCurrentStorageComponentsFactory(configuration);
183186
} catch (Exception e) {
@@ -242,10 +245,15 @@ public boolean exists() {
242245
}
243246

244247
public void close(final boolean iForce, boolean onDelete) {
248+
if (status == STATUS.CLOSED)
249+
return;
250+
245251
OChannelBinaryAsynchClient network = null;
246252

247253
lock.acquireExclusiveLock();
248254
try {
255+
if (status == STATUS.CLOSED)
256+
return;
249257

250258
network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_CLOSE);
251259
try {
@@ -259,6 +267,7 @@ public void close(final boolean iForce, boolean onDelete) {
259267
if (!checkForClose(iForce))
260268
return;
261269

270+
status = STATUS.CLOSING;
262271
// CLOSE ALL THE CONNECTIONS
263272
engine.getConnectionManager().closePool(getCurrentServerURL());
264273

@@ -267,7 +276,6 @@ public void close(final boolean iForce, boolean onDelete) {
267276
status = STATUS.CLOSED;
268277

269278
Orient.instance().unregisterStorage(this);
270-
271279
} catch (Exception e) {
272280
if (network != null) {
273281
OLogManager.instance().debug(this, "Error on closing remote connection: %s", network);

commons/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>com.orientechnologies</groupId>
2626
<artifactId>orientdb-parent</artifactId>
27-
<version>1.7.1</version>
27+
<version>1.7.2</version>
2828
<relativePath>../</relativePath>
2929
</parent>
3030

core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>com.orientechnologies</groupId>
1919
<artifactId>orientdb-parent</artifactId>
20-
<version>1.7.1</version>
20+
<version>1.7.2</version>
2121
<relativePath>../</relativePath>
2222
</parent>
2323

core/src/main/java/com/orientechnologies/orient/core/OConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package com.orientechnologies.orient.core;
1717

1818
public class OConstants {
19-
public static final String ORIENT_VERSION = "1.7.1";
19+
public static final String ORIENT_VERSION = "1.7.2";
2020

2121
public static final String ORIENT_URL = "www.orientechnologies.com";
2222

core/src/main/java/com/orientechnologies/orient/core/cache/OLevel2RecordCache.java

+20-3
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,22 @@
2424
import com.orientechnologies.orient.core.record.ORecordInternal;
2525
import com.orientechnologies.orient.core.storage.OStorage;
2626

27+
import java.util.Collections;
28+
import java.util.Set;
29+
import java.util.concurrent.ConcurrentHashMap;
30+
2731
/**
2832
* Second level cache. It's shared among database instances with the same URL.
2933
*
3034
* @author Luca Garulli
3135
* @author Sylvain Spinelli
3236
*/
3337
public class OLevel2RecordCache extends OAbstractRecordCache {
34-
private final String CACHE_HIT;
35-
private final String CACHE_MISS;
36-
private STRATEGY strategy;
38+
private final String CACHE_HIT;
39+
private final String CACHE_MISS;
40+
private STRATEGY strategy;
41+
42+
private final Set<Integer> pinnedClusters = Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>());
3743

3844
public enum STRATEGY {
3945
POP_RECORD, COPY_RECORD
@@ -57,6 +63,14 @@ public void startup() {
5763
setEnable(OGlobalConfiguration.CACHE_LEVEL2_ENABLED.getValueAsBoolean());
5864
}
5965

66+
public void addPinnedCluster(int clusterId) {
67+
pinnedClusters.add(clusterId);
68+
}
69+
70+
public void removePinnedCluster(int clusterId) {
71+
pinnedClusters.remove(clusterId);
72+
}
73+
6074
/**
6175
* Push record to cache. Identifier of record used as access key
6276
*
@@ -68,6 +82,9 @@ public void updateRecord(final ORecordInternal<?> fresh) {
6882
|| fresh.getIdentity().getClusterId() == excludedCluster || fresh.getRecordVersion().isTombstone())
6983
return;
7084

85+
if (pinnedClusters.contains(fresh.getIdentity().getClusterId()))
86+
fresh.pin();
87+
7188
if (fresh.isPinned() == null || fresh.isPinned()) {
7289
underlying.lock(fresh.getIdentity());
7390
try {

core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public enum OGlobalConfiguration {
132132
STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CLUSTER_CREATE("storage.makeFullCheckpointAfterClusterCreate",
133133
"Indicates whether full checkpoint should be performed if storage was opened.", Boolean.class, true),
134134

135-
DISK_CACHE_PAGE_SIZE("storage.diskCache.pageSize", "Size of page of disk buffer in kilobytes", Integer.class, 64),
135+
DISK_CACHE_PAGE_SIZE("storage.diskCache.pageSize", "Size of page of disk buffer in kilobytes,!!! NEVER CHANGE THIS VALUE !!!",
136+
Integer.class, 64),
136137

137138
PAGINATED_STORAGE_LOWEST_FREELIST_BOUNDARY("storage.lowestFreeListBound", "The minimal amount of free space (in kb)"
138139
+ " in page which is tracked in paginated storage", Integer.class, 16),
@@ -447,13 +448,6 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
447448
NETWORK_HTTP_SESSION_EXPIRE_TIMEOUT("network.http.sessionExpireTimeout",
448449
"Timeout after which an http session is considered tp have expired (seconds)", Integer.class, 300),
449450

450-
// SECURITY
451-
SECURITY_MAX_CACHED_USERS("security.maxCachedUsers",
452-
"Maximum users cached in RAM. This speeds up authentication for the most used users", Integer.class, 100),
453-
454-
SECURITY_MAX_CACHED_ROLES("security.maxCachedRoles",
455-
"Maximum roles cached in RAM. This speeds up authentication for the most used roles", Integer.class, 100),
456-
457451
// PROFILER
458452
PROFILER_ENABLED("profiler.enabled", "Enable the recording of statistics and counters", Boolean.class, false,
459453
new OConfigurationChangeCallback() {
@@ -728,4 +722,3 @@ public String getDescription() {
728722
return description;
729723
}
730724
}
731-

core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java

+38-35
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
import java.io.IOException;
3232
import java.text.DecimalFormatSymbols;
3333
import java.text.SimpleDateFormat;
34-
import java.util.ArrayList;
35-
import java.util.List;
36-
import java.util.Locale;
37-
import java.util.TimeZone;
34+
import java.util.*;
3835

3936
/**
4037
* Versions:
@@ -53,34 +50,40 @@
5350
*/
5451
@SuppressWarnings("serial")
5552
public class OStorageConfiguration implements OSerializableStream {
56-
public static final ORecordId CONFIG_RID = new OImmutableRecordId(0,
57-
OClusterPositionFactory.INSTANCE.valueOf(0));
58-
59-
public static final String DEFAULT_CHARSET = "UTF-8";
60-
private String charset = DEFAULT_CHARSET;
61-
public static final int CURRENT_VERSION = 9;
62-
public static final int CURRENT_BINARY_FORMAT_VERSION = 11;
63-
public int version = -1;
64-
public String name;
65-
public String schemaRecordId;
66-
public String dictionaryRecordId;
67-
public String indexMgrRecordId;
68-
public String dateFormat = "yyyy-MM-dd";
69-
public String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
70-
public int binaryFormatVersion;
71-
public OStorageSegmentConfiguration fileTemplate;
72-
public List<OStorageClusterConfiguration> clusters = new ArrayList<OStorageClusterConfiguration>();
73-
public List<OStorageDataConfiguration> dataSegments = new ArrayList<OStorageDataConfiguration>();
74-
public OStorageTxConfiguration txSegment = new OStorageTxConfiguration();
75-
public List<OStorageEntryConfiguration> properties = new ArrayList<OStorageEntryConfiguration>();
76-
protected transient OStorage storage;
77-
private String localeLanguage = Locale.getDefault().getLanguage();
78-
private String localeCountry = Locale.getDefault().getCountry();
79-
private TimeZone timeZone = TimeZone.getDefault();
80-
private transient Locale localeInstance;
81-
private transient DecimalFormatSymbols unusualSymbols;
82-
private String clusterSelection;
83-
private int minimumClusters = 1;
53+
public static final ORecordId CONFIG_RID = new OImmutableRecordId(0,
54+
OClusterPositionFactory.INSTANCE.valueOf(0));
55+
56+
public static final String DEFAULT_CHARSET = "UTF-8";
57+
private String charset = DEFAULT_CHARSET;
58+
public static final int CURRENT_VERSION = 9;
59+
public static final int CURRENT_BINARY_FORMAT_VERSION = 11;
60+
public volatile int version = -1;
61+
62+
public volatile String name;
63+
public volatile String schemaRecordId;
64+
public volatile String dictionaryRecordId;
65+
public volatile String indexMgrRecordId;
66+
public volatile String dateFormat = "yyyy-MM-dd";
67+
public volatile String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
68+
public volatile int binaryFormatVersion;
69+
public volatile OStorageSegmentConfiguration fileTemplate;
70+
71+
public volatile List<OStorageClusterConfiguration> clusters = Collections
72+
.synchronizedList(new ArrayList<OStorageClusterConfiguration>());
73+
public final List<OStorageDataConfiguration> dataSegments = Collections
74+
.synchronizedList(new ArrayList<OStorageDataConfiguration>());
75+
public volatile OStorageTxConfiguration txSegment = new OStorageTxConfiguration();
76+
public final List<OStorageEntryConfiguration> properties = Collections
77+
.synchronizedList(new ArrayList<OStorageEntryConfiguration>());
78+
79+
protected final transient OStorage storage;
80+
private volatile String localeLanguage = Locale.getDefault().getLanguage();
81+
private volatile String localeCountry = Locale.getDefault().getCountry();
82+
private volatile TimeZone timeZone = TimeZone.getDefault();
83+
private transient volatile Locale localeInstance;
84+
private transient volatile DecimalFormatSymbols unusualSymbols;
85+
private volatile String clusterSelection;
86+
private volatile int minimumClusters = 1;
8487

8588
public OStorageConfiguration(final OStorage iStorage) {
8689
storage = iStorage;
@@ -186,7 +189,7 @@ public OSerializableStream fromStream(final byte[] iStream) throws OSerializatio
186189
int size = Integer.parseInt(read(values[index++]));
187190

188191
// PREPARE THE LIST OF CLUSTERS
189-
clusters = new ArrayList<OStorageClusterConfiguration>(size);
192+
clusters.clear();
190193

191194
for (int i = 0; i < size; ++i) {
192195
final int clusterId = Integer.parseInt(read(values[index++]));
@@ -237,7 +240,7 @@ else if (clusterType.equals("d")) {
237240

238241
// PREPARE THE LIST OF DATA SEGS
239242
size = Integer.parseInt(read(values[index++]));
240-
dataSegments = new ArrayList<OStorageDataConfiguration>(size);
243+
dataSegments.clear();
241244
for (int i = 0; i < size; ++i)
242245
dataSegments.add(null);
243246

@@ -260,7 +263,7 @@ else if (clusterType.equals("d")) {
260263
read(values[index++]), read(values[index++]));
261264

262265
size = Integer.parseInt(read(values[index++]));
263-
properties = new ArrayList<OStorageEntryConfiguration>(size);
266+
properties.clear();
264267
for (int i = 0; i < size; ++i) {
265268
properties.add(new OStorageEntryConfiguration(read(values[index++]), read(values[index++])));
266269
}

core/src/main/java/com/orientechnologies/orient/core/config/OStorageEntryConfiguration.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
@SuppressWarnings("serial")
2121
public class OStorageEntryConfiguration implements Serializable {
22-
public String name;
23-
public String value;
22+
public volatile String name;
23+
public volatile String value;
2424

25-
public OStorageEntryConfiguration() {
26-
}
25+
public OStorageEntryConfiguration() {
26+
}
2727

28-
public OStorageEntryConfiguration(final String iName, final String iValue) {
29-
name = iName;
30-
value = iValue;
31-
}
28+
public OStorageEntryConfiguration(final String iName, final String iValue) {
29+
name = iName;
30+
value = iValue;
31+
}
3232
}

core/src/main/java/com/orientechnologies/orient/core/config/OStorageSegmentConfiguration.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
public class OStorageSegmentConfiguration implements Serializable {
2222
public transient OStorageConfiguration root;
2323

24-
public int id;
25-
public String name;
26-
public String maxSize = "0";
27-
public String fileType = "mmap";
28-
public String fileStartSize = "500Kb";
29-
public String fileMaxSize = "500Mb";
30-
public String fileIncrementSize = "50%";
31-
public String defrag = "auto";
24+
public volatile int id;
25+
public volatile String name;
26+
public volatile String maxSize = "0";
27+
public volatile String fileType = "mmap";
28+
public volatile String fileStartSize = "500Kb";
29+
public volatile String fileMaxSize = "500Mb";
30+
public volatile String fileIncrementSize = "50%";
31+
public volatile String defrag = "auto";
3232

3333
public OStorageFileConfiguration[] infoFiles;
3434
String location;

0 commit comments

Comments
 (0)