Skip to content

Commit bbca826

Browse files
author
lvca
committed
Merge branch 'develop'
2 parents 276fd34 + eaf324d commit bbca826

File tree

422 files changed

+14798
-11433
lines changed

Some content is hidden

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

422 files changed

+14798
-11433
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ build.number
33
*/target/*
44
target
55
*/test-output
6+
out
67
*/databases
78
*.gz
89
*.patch

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,13 @@ Start to learn about OrientDB from the [WiKi Main page](https://github.com/orien
5959

6060
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/orientechnologies/orientdb/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
6161

62+
<script>
63+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
64+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
65+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
66+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
67+
68+
ga('create', 'UA-28543690-2', 'orientechnologies.com');
69+
ga('send', 'pageview');
70+
71+
</script>

build.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<property environment="env"/>
66
<property name="vendor" value="NuvolaBase Ltd"/>
77
<property name="product" value="OrientDB"/>
8-
<property name="version" value="1.7-rc1"/>
8+
<property name="version" value="1.7-rc2"/>
99
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
1010
else="../releases/orientdb-community-${version}">
1111
<isset property="releaseHome"/>
@@ -209,23 +209,23 @@
209209
<target name="test" depends="install">
210210
<subant target="test">
211211
<property name="global.lib" value="../${community.release}/lib"/>
212-
<property name="orient.path" value="${community.release}"/>
212+
<property name="orient.path" value="../${community.release}"/>
213213
<fileset dir="tests" includes="build.xml"/>
214214
</subant>
215215
</target>
216216

217217
<target name="test-local" depends="install">
218218
<subant target="test-local">
219219
<property name="global.lib" value="../${community.release}/lib"/>
220-
<property name="orient.path" value="${community.release}"/>
220+
<property name="orient.path" value="../${community.release}"/>
221221
<fileset dir="tests" includes="build.xml"/>
222222
</subant>
223223
</target>
224224

225225
<target name="test-plocal" depends="install">
226226
<subant target="test-plocal">
227227
<property name="global.lib" value="../${community.release}/lib"/>
228-
<property name="orient.path" value="${community.release}"/>
228+
<property name="orient.path" value="../${community.release}"/>
229229
<fileset dir="tests" includes="build.xml"/>
230230
</subant>
231231
</target>
@@ -234,15 +234,15 @@
234234
<target name="test-remote" depends="install">
235235
<subant target="test-remote">
236236
<property name="global.lib" value="../${community.release}/lib"/>
237-
<property name="orient.path" value="${community.release}"/>
237+
<property name="orient.path" value="../${community.release}"/>
238238
<fileset dir="tests" includes="build.xml"/>
239239
</subant>
240240
</target>
241241

242242
<target name="stress-test">
243243
<subant target="stress-test">
244244
<property name="global.lib" value="../${community.release}/lib"/>
245-
<property name="orient.path" value="${community.release}"/>
245+
<property name="orient.path" value="../${community.release}"/>
246246
<fileset dir="tests" includes="build.xml"/>
247247
</subant>
248248
</target>

client/pom.xml

Lines changed: 1 addition & 1 deletion
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-rc1</version>
27+
<version>1.7-rc2</version>
2828
<relativePath>../</relativePath>
2929
</parent>
3030

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,8 @@ public String compression() {
258258
throw new UnsupportedOperationException("compression()");
259259
}
260260

261+
@Override
262+
public boolean hideRecord(OClusterPosition position) {
263+
throw new UnsupportedOperationException("Operation is not supported for given cluster implementation");
264+
}
261265
}

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

Lines changed: 0 additions & 91 deletions
This file was deleted.

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public V get(K key) {
6969
storage.endResponse(client);
7070

7171
final byte serializerId = OByteSerializer.INSTANCE.deserialize(stream, 0);
72-
final OBinarySerializer<V> serializer = (OBinarySerializer<V>) OBinarySerializerFactory.INSTANCE
73-
.getObjectSerializer(serializerId);
72+
final OBinarySerializer<V> serializer = (OBinarySerializer<V>) OBinarySerializerFactory.getInstance().getObjectSerializer(
73+
serializerId);
7474
return serializer.deserialize(stream, OByteSerializer.BYTE_SIZE);
7575
} catch (IOException e) {
7676
throw new ODatabaseException("Can't get first key from sb-tree bonsai.", e);
@@ -118,7 +118,10 @@ public Collection<V> getValuesMajor(K key, boolean inclusive, int maxValuesToFet
118118
}
119119

120120
@Override
121-
public void loadEntriesMajor(K key, boolean inclusive, RangeResultListener<K, V> listener) {
121+
public void loadEntriesMajor(K key, boolean inclusive, boolean ascSortOrder, RangeResultListener<K, V> listener) {
122+
if (!ascSortOrder)
123+
throw new IllegalStateException("Descending sort order is not supported.");
124+
122125
List<Map.Entry<K, V>> entries = fetchEntriesMajor(key, inclusive);
123126

124127
while (pushEntriesToListener(listener, entries)) {
@@ -195,8 +198,8 @@ public K firstKey() {
195198
storage.endResponse(client);
196199

197200
final byte serializerId = OByteSerializer.INSTANCE.deserialize(stream, 0);
198-
final OBinarySerializer<K> serializer = (OBinarySerializer<K>) OBinarySerializerFactory.INSTANCE
199-
.getObjectSerializer(serializerId);
201+
final OBinarySerializer<K> serializer = (OBinarySerializer<K>) OBinarySerializerFactory.getInstance().getObjectSerializer(
202+
serializerId);
200203
return serializer.deserialize(stream, OByteSerializer.BYTE_SIZE);
201204
} catch (IOException e) {
202205
throw new ODatabaseException("Can't get first key from sb-tree bonsai.", e);

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ public class OSBTreeCollectionManagerRemote extends OSBTreeCollectionManagerAbst
2828
private final OCollectionNetworkSerializer networkSerializer;
2929
private boolean remoteCreationAllowed = false;
3030

31-
private Map<UUID, WeakReference<ORidBag>> pendingCollections = new HashMap<UUID, WeakReference<ORidBag>>();
31+
private ThreadLocal<Map<UUID, WeakReference<ORidBag>>> pendingCollections = new ThreadLocal<Map<UUID, WeakReference<ORidBag>>>() {
32+
@Override
33+
protected Map<UUID, WeakReference<ORidBag>> initialValue() {
34+
return new HashMap<UUID, WeakReference<ORidBag>>();
35+
}
36+
};
3237

3338
public OSBTreeCollectionManagerRemote() {
3439
super();
@@ -80,15 +85,15 @@ public UUID listenForChanges(ORidBag collection) {
8085
if (id == null)
8186
id = UUID.randomUUID();
8287

83-
pendingCollections.put(id, new WeakReference<ORidBag>(collection));
88+
pendingCollections.get().put(id, new WeakReference<ORidBag>(collection));
8489

8590
return id;
8691
}
8792

8893
@Override
8994
public void updateCollectionPointer(UUID uuid, OBonsaiCollectionPointer pointer) {
90-
final WeakReference<ORidBag> reference = pendingCollections.get(uuid);
91-
if (reference == null) {
95+
final WeakReference<ORidBag> reference = pendingCollections.get().get(uuid);
96+
if (reference == null) {
9297
OLogManager.instance().warn(this, "Update of collection pointer is received but collection is not registered");
9398
return;
9499
}
@@ -102,7 +107,7 @@ public void updateCollectionPointer(UUID uuid, OBonsaiCollectionPointer pointer)
102107

103108
@Override
104109
public void clearPendingCollections() {
105-
pendingCollections.clear();
110+
pendingCollections.get().clear();
106111
}
107112

108113
@Override

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,24 @@ public synchronized OServerAdmin createDatabase(final String iDatabaseName, fina
209209
return this;
210210
}
211211

212+
/**
213+
* Checks if a database exists in the remote server.
214+
*
215+
* @return true if exists, otherwise false
216+
*/
217+
public synchronized boolean existsDatabase() throws IOException {
218+
return existsDatabase(null);
219+
}
220+
212221
/**
213222
* Checks if a database exists in the remote server.
214223
*
215224
* @return true if exists, otherwise false
216225
* @throws IOException
217226
* @param storageType
227+
* The storage type to check between memory, local and plocal.
218228
*/
219-
public synchronized boolean existsDatabase(String storageType) throws IOException {
229+
public synchronized boolean existsDatabase(final String storageType) throws IOException {
220230
storage.checkConnection();
221231

222232
try {
@@ -486,6 +496,7 @@ public synchronized String getGlobalConfiguration(final OGlobalConfiguration iCo
486496
try {
487497
final OChannelBinaryAsynchClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONFIG_GET);
488498
network.writeString(iConfig.getKey());
499+
network.endRequest();
489500

490501
try {
491502
storage.beginResponse(network);

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

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import com.orientechnologies.orient.core.config.OStorageConfiguration;
6161
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
6262
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
63+
import com.orientechnologies.orient.core.db.record.OCurrentStorageComponentsFactory;
6364
import com.orientechnologies.orient.core.db.record.ODatabaseRecord;
6465
import com.orientechnologies.orient.core.db.record.OIdentifiable;
6566
import com.orientechnologies.orient.core.db.record.ORecordOperation;
@@ -75,6 +76,7 @@
7576
import com.orientechnologies.orient.core.record.ORecordInternal;
7677
import com.orientechnologies.orient.core.record.impl.ODocument;
7778
import com.orientechnologies.orient.core.serialization.OSerializableStream;
79+
import com.orientechnologies.orient.core.serialization.serializer.binary.OBinarySerializerFactory;
7880
import com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract;
7981
import com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializerAnyStreamable;
8082
import com.orientechnologies.orient.core.storage.OCluster;
@@ -140,24 +142,24 @@ public OStorageRemote(final String iClientId, final String iURL, final String iM
140142
this(iClientId, iURL, iMode, null);
141143
}
142144

143-
public OStorageRemote(final String iClientId, final String iURL, final String iMode, STATUS status) throws IOException {
144-
super(iURL, iURL, iMode, 0, new OCacheLevelTwoLocatorRemote()); // NO TIMEOUT @SINCE 1.5
145-
if (status != null)
146-
this.status = status;
145+
public OStorageRemote(final String iClientId, final String iURL, final String iMode, STATUS status) throws IOException {
146+
super(iURL, iURL, iMode, 0, new OCacheLevelTwoLocatorRemote()); // NO TIMEOUT @SINCE 1.5
147+
if (status != null)
148+
this.status = status;
147149

148-
clientId = iClientId;
149-
configuration = null;
150+
clientId = iClientId;
151+
configuration = null;
150152

151-
clientConfiguration = new OContextConfiguration();
152-
connectionRetry = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY);
153-
connectionRetryDelay = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY_DELAY);
154-
asynchEventListener = new OStorageRemoteAsynchEventListener(this);
155-
parseServerURLs();
153+
clientConfiguration = new OContextConfiguration();
154+
connectionRetry = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY);
155+
connectionRetryDelay = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY_DELAY);
156+
asynchEventListener = new OStorageRemoteAsynchEventListener(this);
157+
parseServerURLs();
156158

157-
asynchExecutor = Executors.newSingleThreadScheduledExecutor();
159+
asynchExecutor = Executors.newSingleThreadScheduledExecutor();
158160

159-
maxReadQueue = Runtime.getRuntime().availableProcessors() - 1;
160-
}
161+
maxReadQueue = Runtime.getRuntime().availableProcessors() - 1;
162+
}
161163

162164
public int getSessionId() {
163165
return OStorageRemoteThreadLocal.INSTANCE.get().sessionId.intValue();
@@ -201,6 +203,7 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
201203
configuration = new OStorageConfiguration(this);
202204
configuration.load();
203205

206+
componentsFactory = new OCurrentStorageComponentsFactory(configuration);
204207
} catch (Exception e) {
205208
if (!OGlobalConfiguration.STORAGE_KEEP_OPEN.getValueAsBoolean())
206209
close();
@@ -634,7 +637,7 @@ public boolean cleanOutRecord(ORecordId recordId, ORecordVersion recordVersion,
634637

635638
@Override
636639
public void backup(OutputStream out, Map<String, Object> options, Callable<Object> callable,
637-
final OCommandOutputListener iListener) throws IOException {
640+
final OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOException {
638641
throw new UnsupportedOperationException("backup");
639642
}
640643

@@ -1148,7 +1151,7 @@ public void commit(final OTransaction iTx, Runnable callback) {
11481151

11491152
// SET ALL THE RECORDS AS UNDIRTY
11501153
for (ORecordOperation txEntry : iTx.getAllRecordEntries())
1151-
txEntry.getRecord().unload();
1154+
txEntry.getRecord().unsetDirty();
11521155

11531156
// UPDATE THE CACHE ONLY IF THE ITERATOR ALLOWS IT. USE THE STRATEGY TO ALWAYS REMOVE ALL THE RECORDS SINCE THEY COULD BE
11541157
// CHANGED AS CONTENT IN CASE OF TREE AND GRAPH DUE TO CROSS REFERENCES
@@ -2122,12 +2125,12 @@ public ODataSegment getDataSegmentById(final int iDataSegmentId) {
21222125
}
21232126

21242127
public int getClusters() {
2125-
lock.acquireSharedLock();
2126-
try {
2127-
return clusterMap.size();
2128-
} finally {
2129-
lock.releaseSharedLock();
2130-
}
2128+
lock.acquireSharedLock();
2129+
try {
2130+
return clusterMap.size();
2131+
} finally {
2132+
lock.releaseSharedLock();
2133+
}
21312134
}
21322135

21332136
public void setDefaultClusterId(int defaultClusterId) {

0 commit comments

Comments
 (0)