Skip to content

Commit

Permalink
Merge branch '1.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Jun 4, 2014
2 parents 1464bdb + bfcdc50 commit 86cc043
Show file tree
Hide file tree
Showing 74 changed files with 1,222 additions and 919 deletions.
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="installg" name="orient-ant">
<!-- Copyright (c) 1999-2011 Luca Garulli - LICENSE: Apache 2.0 -->
<!-- Copyright (c) 1999-2013 Orient Technologies LTD - LICENSE: Apache 2.0 -->

<property environment="env"/>
<property name="vendor" value="NuvolaBase Ltd"/>
<property name="vendor" value="Orient Technologies Ltd"/>
<property name="product" value="OrientDB"/>
<property name="version" value="1.7"/>
<property name="version" value="1.7.1"/>
<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</version>
<version>1.7.1</version>
<relativePath>../</relativePath>
</parent>

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</version>
<version>1.7.1</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ else if (iObject instanceof Iterator<?> || iObject instanceof Iterable<?>) {
: (Iterator<Object>) iObject;
for (int i = 0; it.hasNext(); ++i) {
final Object o = it.next();
if (i == iIndex)
if (i == iIndex) {
if (it instanceof OResettable)
((OResettable) it).reset();

return o;
}
}

if (it instanceof OResettable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Locale;

public class OFileUtils {
private static final int KILOBYTE = 1024;
private static final int MEGABYTE = 1048576;
private static final int GIGABYTE = 1073741824;
private static final long TERABYTE = 1099511627776L;
private static final boolean useOldFileAPI = System.getProperty("java.version").startsWith("1.6");

private static final int KILOBYTE = 1024;
private static final int MEGABYTE = 1048576;
private static final int GIGABYTE = 1073741824;
private static final long TERABYTE = 1099511627776L;

public static long getSizeAsNumber(final Object iSize) {
if (iSize == null)
Expand Down Expand Up @@ -159,4 +165,32 @@ public static final void copyDirectory(final File source, final File destination
copyDirectory(f, target);
}
}

public static boolean renameFile(File from, File to) throws IOException {
if (useOldFileAPI)
return from.renameTo(to);

final FileSystem fileSystem = FileSystems.getDefault();

final Path fromPath = fileSystem.getPath(from.getAbsolutePath());
final Path toPath = fileSystem.getPath(to.getAbsolutePath());
Files.move(fromPath, toPath);

return true;
}

public static boolean delete(File file) throws IOException {
if (!file.exists())
return true;

if (useOldFileAPI)
return file.delete();

final FileSystem fileSystem = FileSystems.getDefault();
final Path path = fileSystem.getPath(file.getAbsolutePath());

Files.delete(path);

return true;
}
}
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</version>
<version>1.7.1</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";
public static final String ORIENT_VERSION = "1.7.1";

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
*/
package com.orientechnologies.orient.core.command.script;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.orientechnologies.orient.core.command.OBasicCommandContext;
import com.orientechnologies.orient.core.db.ODataSegmentStrategy;
import com.orientechnologies.orient.core.db.ODatabase;
Expand All @@ -46,11 +40,18 @@
import com.orientechnologies.orient.core.record.ORecordInternal;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.OCommandSQL;
import com.orientechnologies.orient.core.sql.query.OSQLQuery;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.core.storage.ORecordCallback;
import com.orientechnologies.orient.core.tx.OTransaction;
import com.orientechnologies.orient.core.version.ORecordVersion;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

/**
* Document Database wrapper class to use from scripts.
*
Expand Down Expand Up @@ -84,7 +85,11 @@ public OIdentifiable[] query(final String iText) {
}

public OIdentifiable[] query(final String iText, final Object... iParameters) {
final List<OIdentifiable> res = database.query(new OSQLSynchQuery<Object>(iText), convertParameters(iParameters));
return query(new OSQLSynchQuery<Object>(iText), iParameters);
}

public OIdentifiable[] query(final OSQLQuery iQuery, final Object... iParameters) {
final List<OIdentifiable> res = database.query(iQuery, convertParameters(iParameters));
if (res == null)
return new OIdentifiable[] {};
return res.toArray(new OIdentifiable[res.size()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
*/
package com.orientechnologies.orient.core.db;

import java.io.Closeable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.Callable;

import com.orientechnologies.orient.core.cache.OLevel1RecordCache;
import com.orientechnologies.orient.core.cache.OLevel2RecordCache;
import com.orientechnologies.orient.core.exception.ODatabaseException;
Expand All @@ -25,12 +31,6 @@
import com.orientechnologies.orient.core.storage.OStorage.CLUSTER_TYPE;
import com.orientechnologies.orient.core.util.OBackupable;

import java.io.Closeable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.Callable;

/**
* Generic Database interface. Represents the lower level of the Database providing raw API to access to the raw records.<br/>
* Limits:
Expand Down Expand Up @@ -116,14 +116,14 @@ public static enum ATTRIBUTES {
public STATUS getStatus();

/**
* Returns the total size of database as the real used space.
* Returns the current status of database.
*/
public long getSize();
public <DB extends ODatabase> DB setStatus(STATUS iStatus);

/**
* Returns the current status of database.
* Returns the total size of database as the real used space.
*/
public <DB extends ODatabase> DB setStatus(STATUS iStatus);
public long getSize();

/**
* Returns the database name.
Expand Down Expand Up @@ -444,17 +444,21 @@ public int addCluster(String iType, String iClusterName, int iRequestedId, Strin
/**
* Flush cached storage content to the disk.
*
* After this call users can perform only select queries. All write-related commands will queued till {@link #release()} command
* will be called.
* After this call users can perform only idempotent calls like read records and select/traverse queries. All write-related
* operations will queued till {@link #release()} command will be called.
*
* Given command waits till all on going modifications in indexes or DB will be finished.
*
* IMPORTANT: This command is not reentrant.
*
* @see #release()
*/
public void freeze();

/**
* Allows to execute write-related commands on DB. Called after {@link #freeze()} command.
*
* @see #freeze()
*/
public void release();

Expand Down
Loading

0 comments on commit 86cc043

Please sign in to comment.