Skip to content

Commit

Permalink
Merge branch '1.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii0lomakin committed Jun 8, 2014
2 parents fa8cb56 + 0e74814 commit d922e9c
Show file tree
Hide file tree
Showing 55 changed files with 605 additions and 440 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<property environment="env"/>
<property name="vendor" value="Orient Technologies Ltd"/>
<property name="product" value="OrientDB"/>
<property name="version" value="1.7.1"/>
<property name="version" value="1.7.2"/>
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
else="../releases/orientdb-community-${version}">
<isset property="releaseHome"/>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.7.1</version>
<version>1.7.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public OEngineRemote() {
}

public OStorage createStorage(final String iURL, final Map<String, String> iConfiguration) {
OGlobalConfiguration.SECURITY_MAX_CACHED_ROLES.setValue(0);
OGlobalConfiguration.SECURITY_MAX_CACHED_USERS.setValue(0);

try {
synchronized (sharedStorages) {
OStorageRemote sharedStorage = sharedStorages.get(iURL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ private List<Map.Entry<K, V>> fetchEntriesMajor(K key, boolean inclusive) {
client.writeBytes(keyStream);
client.writeBoolean(inclusive);

if (client.getSrvProtocolVersion() >= 21)
client.writeInt(128);

storage.endRequest(client);

storage.beginResponse(client);
Expand Down Expand Up @@ -253,27 +256,27 @@ public OBinarySerializer<V> getValueSerializer() {
return valueSerializer;
}

class TreeEntry<K, V> implements Map.Entry<K, V> {
private final K key;
private final V value;
class TreeEntry<EK, EV> implements Map.Entry<EK, EV> {
private final EK key;
private final EV value;

TreeEntry(K key, V value) {
TreeEntry(EK key, EV value) {
this.key = key;
this.value = value;
}

@Override
public K getKey() {
public EK getKey() {
return key;
}

@Override
public V getValue() {
public EV getValue() {
return value;
}

@Override
public V setValue(V value) {
public EV setValue(EV value) {
throw new UnsupportedOperationException();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.orientechnologies.orient.core.storage.OStorageAbstract;
import com.orientechnologies.orient.core.storage.OStorageOperationResult;
import com.orientechnologies.orient.core.storage.OStorageProxy;
import com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment;
import com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext;
import com.orientechnologies.orient.core.tx.OTransaction;
import com.orientechnologies.orient.core.tx.OTransactionAbstract;
Expand Down Expand Up @@ -176,8 +177,10 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
// POST OPEN
openRemoteDatabase();

configuration = new OStorageConfiguration(this);
configuration.load();
final OStorageConfiguration storageConfiguration = new OStorageConfiguration(this);
storageConfiguration.load();

configuration = storageConfiguration;

componentsFactory = new OCurrentStorageComponentsFactory(configuration);
} catch (Exception e) {
Expand Down Expand Up @@ -242,10 +245,15 @@ public boolean exists() {
}

public void close(final boolean iForce, boolean onDelete) {
if (status == STATUS.CLOSED)
return;

OChannelBinaryAsynchClient network = null;

lock.acquireExclusiveLock();
try {
if (status == STATUS.CLOSED)
return;

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

status = STATUS.CLOSING;
// CLOSE ALL THE CONNECTIONS
engine.getConnectionManager().closePool(getCurrentServerURL());

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

Orient.instance().unregisterStorage(this);

} catch (Exception e) {
if (network != null) {
OLogManager.instance().debug(this, "Error on closing remote connection: %s", network);
Expand Down
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.7.1</version>
<version>1.7.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.7.1</version>
<version>1.7.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.orientechnologies.orient.core;

public class OConstants {
public static final String ORIENT_VERSION = "1.7.1";
public static final String ORIENT_VERSION = "1.7.2";

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@
import com.orientechnologies.orient.core.record.ORecordInternal;
import com.orientechnologies.orient.core.storage.OStorage;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* Second level cache. It's shared among database instances with the same URL.
*
* @author Luca Garulli
* @author Sylvain Spinelli
*/
public class OLevel2RecordCache extends OAbstractRecordCache {
private final String CACHE_HIT;
private final String CACHE_MISS;
private STRATEGY strategy;
private final String CACHE_HIT;
private final String CACHE_MISS;
private STRATEGY strategy;

private final Set<Integer> pinnedClusters = Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>());

public enum STRATEGY {
POP_RECORD, COPY_RECORD
Expand All @@ -57,6 +63,14 @@ public void startup() {
setEnable(OGlobalConfiguration.CACHE_LEVEL2_ENABLED.getValueAsBoolean());
}

public void addPinnedCluster(int clusterId) {
pinnedClusters.add(clusterId);
}

public void removePinnedCluster(int clusterId) {
pinnedClusters.remove(clusterId);
}

/**
* Push record to cache. Identifier of record used as access key
*
Expand All @@ -68,6 +82,9 @@ public void updateRecord(final ORecordInternal<?> fresh) {
|| fresh.getIdentity().getClusterId() == excludedCluster || fresh.getRecordVersion().isTombstone())
return;

if (pinnedClusters.contains(fresh.getIdentity().getClusterId()))
fresh.pin();

if (fresh.isPinned() == null || fresh.isPinned()) {
underlying.lock(fresh.getIdentity());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public enum OGlobalConfiguration {
STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CLUSTER_CREATE("storage.makeFullCheckpointAfterClusterCreate",
"Indicates whether full checkpoint should be performed if storage was opened.", Boolean.class, true),

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

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

// SECURITY
SECURITY_MAX_CACHED_USERS("security.maxCachedUsers",
"Maximum users cached in RAM. This speeds up authentication for the most used users", Integer.class, 100),

SECURITY_MAX_CACHED_ROLES("security.maxCachedRoles",
"Maximum roles cached in RAM. This speeds up authentication for the most used roles", Integer.class, 100),

// PROFILER
PROFILER_ENABLED("profiler.enabled", "Enable the recording of statistics and counters", Boolean.class, false,
new OConfigurationChangeCallback() {
Expand Down Expand Up @@ -728,4 +722,3 @@ public String getDescription() {
return description;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
import java.io.IOException;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.*;

/**
* Versions:
Expand All @@ -53,34 +50,40 @@
*/
@SuppressWarnings("serial")
public class OStorageConfiguration implements OSerializableStream {
public static final ORecordId CONFIG_RID = new OImmutableRecordId(0,
OClusterPositionFactory.INSTANCE.valueOf(0));

public static final String DEFAULT_CHARSET = "UTF-8";
private String charset = DEFAULT_CHARSET;
public static final int CURRENT_VERSION = 9;
public static final int CURRENT_BINARY_FORMAT_VERSION = 11;
public int version = -1;
public String name;
public String schemaRecordId;
public String dictionaryRecordId;
public String indexMgrRecordId;
public String dateFormat = "yyyy-MM-dd";
public String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
public int binaryFormatVersion;
public OStorageSegmentConfiguration fileTemplate;
public List<OStorageClusterConfiguration> clusters = new ArrayList<OStorageClusterConfiguration>();
public List<OStorageDataConfiguration> dataSegments = new ArrayList<OStorageDataConfiguration>();
public OStorageTxConfiguration txSegment = new OStorageTxConfiguration();
public List<OStorageEntryConfiguration> properties = new ArrayList<OStorageEntryConfiguration>();
protected transient OStorage storage;
private String localeLanguage = Locale.getDefault().getLanguage();
private String localeCountry = Locale.getDefault().getCountry();
private TimeZone timeZone = TimeZone.getDefault();
private transient Locale localeInstance;
private transient DecimalFormatSymbols unusualSymbols;
private String clusterSelection;
private int minimumClusters = 1;
public static final ORecordId CONFIG_RID = new OImmutableRecordId(0,
OClusterPositionFactory.INSTANCE.valueOf(0));

public static final String DEFAULT_CHARSET = "UTF-8";
private String charset = DEFAULT_CHARSET;
public static final int CURRENT_VERSION = 9;
public static final int CURRENT_BINARY_FORMAT_VERSION = 11;
public volatile int version = -1;

public volatile String name;
public volatile String schemaRecordId;
public volatile String dictionaryRecordId;
public volatile String indexMgrRecordId;
public volatile String dateFormat = "yyyy-MM-dd";
public volatile String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
public volatile int binaryFormatVersion;
public volatile OStorageSegmentConfiguration fileTemplate;

public volatile List<OStorageClusterConfiguration> clusters = Collections
.synchronizedList(new ArrayList<OStorageClusterConfiguration>());
public final List<OStorageDataConfiguration> dataSegments = Collections
.synchronizedList(new ArrayList<OStorageDataConfiguration>());
public volatile OStorageTxConfiguration txSegment = new OStorageTxConfiguration();
public final List<OStorageEntryConfiguration> properties = Collections
.synchronizedList(new ArrayList<OStorageEntryConfiguration>());

protected final transient OStorage storage;
private volatile String localeLanguage = Locale.getDefault().getLanguage();
private volatile String localeCountry = Locale.getDefault().getCountry();
private volatile TimeZone timeZone = TimeZone.getDefault();
private transient volatile Locale localeInstance;
private transient volatile DecimalFormatSymbols unusualSymbols;
private volatile String clusterSelection;
private volatile int minimumClusters = 1;

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

// PREPARE THE LIST OF CLUSTERS
clusters = new ArrayList<OStorageClusterConfiguration>(size);
clusters.clear();

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

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

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

size = Integer.parseInt(read(values[index++]));
properties = new ArrayList<OStorageEntryConfiguration>(size);
properties.clear();
for (int i = 0; i < size; ++i) {
properties.add(new OStorageEntryConfiguration(read(values[index++]), read(values[index++])));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

@SuppressWarnings("serial")
public class OStorageEntryConfiguration implements Serializable {
public String name;
public String value;
public volatile String name;
public volatile String value;

public OStorageEntryConfiguration() {
}
public OStorageEntryConfiguration() {
}

public OStorageEntryConfiguration(final String iName, final String iValue) {
name = iName;
value = iValue;
}
public OStorageEntryConfiguration(final String iName, final String iValue) {
name = iName;
value = iValue;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
public class OStorageSegmentConfiguration implements Serializable {
public transient OStorageConfiguration root;

public int id;
public String name;
public String maxSize = "0";
public String fileType = "mmap";
public String fileStartSize = "500Kb";
public String fileMaxSize = "500Mb";
public String fileIncrementSize = "50%";
public String defrag = "auto";
public volatile int id;
public volatile String name;
public volatile String maxSize = "0";
public volatile String fileType = "mmap";
public volatile String fileStartSize = "500Kb";
public volatile String fileMaxSize = "500Mb";
public volatile String fileIncrementSize = "50%";
public volatile String defrag = "auto";

public OStorageFileConfiguration[] infoFiles;
String location;
Expand Down
Loading

0 comments on commit d922e9c

Please sign in to comment.