Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
3c7e2241
提交
3c7e2241
authored
6月 12, 2014
作者:
noelgrandin@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove dead code
上级
a2bb8c17
显示空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
1 行增加
和
445 行删除
+1
-445
_messages_en.prop
h2/src/docsrc/textbase/_messages_en.prop
+0
-2
ErrorCode.java
h2/src/main/org/h2/api/ErrorCode.java
+0
-14
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+1
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+0
-5
FunctionCall.java
h2/src/main/org/h2/expression/FunctionCall.java
+0
-7
JavaFunction.java
h2/src/main/org/h2/expression/JavaFunction.java
+0
-5
TraceObject.java
h2/src/main/org/h2/message/TraceObject.java
+0
-19
MVTableEngine.java
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
+0
-6
ValueDataType.java
h2/src/main/org/h2/mvstore/db/ValueDataType.java
+0
-2
_messages_cs.prop
h2/src/main/org/h2/res/_messages_cs.prop
+0
-2
_messages_de.prop
h2/src/main/org/h2/res/_messages_de.prop
+0
-2
_messages_en.prop
h2/src/main/org/h2/res/_messages_en.prop
+0
-2
_messages_es.prop
h2/src/main/org/h2/res/_messages_es.prop
+0
-2
_messages_ja.prop
h2/src/main/org/h2/res/_messages_ja.prop
+0
-2
_messages_pl.prop
h2/src/main/org/h2/res/_messages_pl.prop
+0
-2
_messages_pt_br.prop
h2/src/main/org/h2/res/_messages_pt_br.prop
+0
-2
_messages_ru.prop
h2/src/main/org/h2/res/_messages_ru.prop
+0
-2
_messages_sk.prop
h2/src/main/org/h2/res/_messages_sk.prop
+0
-2
_messages_zh_cn.prop
h2/src/main/org/h2/res/_messages_zh_cn.prop
+0
-2
ResultDiskBuffer.java
h2/src/main/org/h2/result/ResultDiskBuffer.java
+0
-302
FilePath.java
h2/src/main/org/h2/store/fs/FilePath.java
+0
-31
Recorder.java
h2/src/main/org/h2/store/fs/Recorder.java
+0
-11
ValueGeometry.java
h2/src/main/org/h2/value/ValueGeometry.java
+0
-20
没有找到文件。
h2/src/docsrc/textbase/_messages_en.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Collation cannot be changed because there is a data table: {0}
90090=Schema {0} cannot be dropped
90091=Role {0} cannot be dropped
90092=This Java version is not supported (Java 1.4 is required)
90093=Clustering error - database currently runs in standalone mode
90094=Clustering error - database currently runs in cluster mode, server list: {0}
90095=String format error: {0}
...
...
@@ -124,7 +123,6 @@
90097=The database is read only
90098=The database has been closed
90099=Error setting database event listener {0}, cause: {1}
90100=No disk space available
90101=Wrong XID format: {0}
90102=Unsupported compression options: {0}
90103=Unsupported compression algorithm: {0}
...
...
h2/src/main/org/h2/api/ErrorCode.java
浏览文件 @
3c7e2241
...
...
@@ -1402,13 +1402,6 @@ public class ErrorCode {
*/
public
static
final
int
ROLE_CAN_NOT_BE_DROPPED_1
=
90091
;
/**
* The error with code <code>90092</code> is thrown when
* the source code is not compiled for the Java platform used.
* At runtime, the existence of the class java.sql.Savepoint is checked.
*/
public
static
final
int
UNSUPPORTED_JAVA_VERSION
=
90092
;
/**
* The error with code <code>90093</code> is thrown when
* trying to connect to a clustered database that runs in standalone
...
...
@@ -1472,13 +1465,6 @@ public class ErrorCode {
*/
public
static
final
int
ERROR_SETTING_DATABASE_EVENT_LISTENER_2
=
90099
;
/**
* The error with code <code>90100</code> is thrown when
* there is no more space available on the device where the database
* files are stored.
*/
public
static
final
int
NO_DISK_SPACE_AVAILABLE
=
90100
;
/**
* The error with code <code>90101</code> is thrown when
* the XA API detected unsupported transaction names. This can happen
...
...
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
3c7e2241
...
...
@@ -94,7 +94,7 @@ public class SysProperties {
* to use Safari, use:
* <code>java -Dh2.browser="open,-a,Safari,%url" ...</code>.
*/
public
static
final
String
BROWSER
=
public
static
final
String
BROWSER
1
=
Utils
.
getProperty
(
H2_BROWSER
,
null
);
/**
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
3c7e2241
...
...
@@ -2507,11 +2507,6 @@ public class Function extends Expression implements FunctionCall {
return
info
.
name
;
}
@Override
public
int
getParameterCount
()
{
return
args
.
length
;
}
@Override
public
ValueResultSet
getValueForColumnList
(
Session
session
,
Expression
[]
argList
)
{
...
...
h2/src/main/org/h2/expression/FunctionCall.java
浏览文件 @
3c7e2241
...
...
@@ -22,13 +22,6 @@ public interface FunctionCall {
*/
String
getName
();
/**
* Get the number of parameters.
*
* @return the number of parameters
*/
int
getParameterCount
();
/**
* Get an empty result set with the column names set.
*
...
...
h2/src/main/org/h2/expression/JavaFunction.java
浏览文件 @
3c7e2241
...
...
@@ -121,11 +121,6 @@ public class JavaFunction extends Expression implements FunctionCall {
return
functionAlias
.
getName
();
}
@Override
public
int
getParameterCount
()
{
return
javaMethod
.
getParameterCount
();
}
@Override
public
ValueResultSet
getValueForColumnList
(
Session
session
,
Expression
[]
argList
)
{
...
...
h2/src/main/org/h2/message/TraceObject.java
浏览文件 @
3c7e2241
...
...
@@ -51,11 +51,6 @@ public class TraceObject {
*/
protected
static
final
int
SAVEPOINT
=
6
;
/**
* The trace type id for sql exceptions.
*/
protected
static
final
int
SQL_EXCEPTION
=
7
;
/**
* The trace type id for statements.
*/
...
...
@@ -86,11 +81,6 @@ public class TraceObject {
*/
protected
static
final
int
XA_DATA_SOURCE
=
13
;
/**
* The trace type id for XA resources.
*/
protected
static
final
int
XA_RESOURCE
=
14
;
/**
* The trace type id for transaction ids.
*/
...
...
@@ -128,15 +118,6 @@ public class TraceObject {
this
.
id
=
id
;
}
/**
* Get the trace object.
*
* @return the trace object
*/
protected
Trace
getTrace
()
{
return
trace
;
}
/**
* INTERNAL
*/
...
...
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
浏览文件 @
3c7e2241
...
...
@@ -135,11 +135,6 @@ public class MVTableEngine implements TableEngine {
*/
public
static
class
Store
{
/**
* The database.
*/
final
Database
db
;
/**
* The map of open tables.
* Key: the map name, value: the table.
...
...
@@ -162,7 +157,6 @@ public class MVTableEngine implements TableEngine {
private
int
temporaryMapId
;
public
Store
(
Database
db
,
MVStore
store
)
{
this
.
db
=
db
;
this
.
store
=
store
;
this
.
transactionStore
=
new
TransactionStore
(
store
,
...
...
h2/src/main/org/h2/mvstore/db/ValueDataType.java
浏览文件 @
3c7e2241
...
...
@@ -54,8 +54,6 @@ import org.h2.value.ValueUuid;
*/
public
class
ValueDataType
implements
DataType
{
static
final
String
PREFIX
=
ValueDataType
.
class
.
getName
();
private
static
final
int
INT_0_15
=
32
;
private
static
final
int
LONG_0_7
=
48
;
private
static
final
int
DECIMAL_0_1
=
56
;
...
...
h2/src/main/org/h2/res/_messages_cs.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Porovnání nemůže být změněno, protože jde o datovou tabulku: {0}
90090=Schéma {0} nemůže být odstraněno
90091=Role {0} nemůže být odstraněna
90092=Tato verze Javy není podporována (je vyžadována alespoň Java 1.4)
90093=Chyba clusteru - databáze je spuštěna v samostatném režimu
90094=Chyba clusteru - databáze je spuštěna v cluster režimu, seznam serverů: {0}
90095=Chyba formátu řetězce: {0}
...
...
@@ -124,7 +123,6 @@
90097=Databáze je pouze pro čtení
90098=Databáze byla ukončena
90099=Chyba nastavení posluchače událostí databáze {0}, příčina: {1}
90100=Na disku není k dispozici žádné volné místo
90101=Špatný XID formát: {0}
90102=Nepodporovaná kompresní volba: {0}
90103=Nepodporovaný kompresní algoritmus: {0}
...
...
h2/src/main/org/h2/res/_messages_de.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Textvergleich-Modus kann nicht geändert werden wenn eine Daten-Tabelle existiert : {0}
90090=Schema {0} kann nicht gelöscht werden
90091=Rolle {0} kann nicht gelöscht werden
90092=Diese Java-Version wird nicht unterstützt (Java 1.4 oder neuer wird benötigt)
90093=Clustering Fehler - Datenbank läuft bereits im autonomen Modus
90094=Clustering Fehler - Datenbank läuft bereits im Cluster Modus, Serverliste: {0}
90095=Textformat Fehler: {0}
...
...
@@ -124,7 +123,6 @@
90097=Die Datenbank ist schreibgeschützt
90098=Die Datenbank ist bereits geschlossen
90099=Fehler beim Setzen des Datenbank Ereignis Empfängers {0}, Grund: {1}
90100=Kein Festplatten Speicherplatz verfügbar
90101=Falsches XID Format: {0}
90102=Datenkompressions-Option nicht unterstützt: {0}
90103=Datenkompressions-Algorithmus nicht unterstützt: {0}
...
...
h2/src/main/org/h2/res/_messages_en.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Collation cannot be changed because there is a data table: {0}
90090=Schema {0} cannot be dropped
90091=Role {0} cannot be dropped
90092=This Java version is not supported (Java 1.4 is required)
90093=Clustering error - database currently runs in standalone mode
90094=Clustering error - database currently runs in cluster mode, server list: {0}
90095=String format error: {0}
...
...
@@ -124,7 +123,6 @@
90097=The database is read only
90098=The database has been closed
90099=Error setting database event listener {0}, cause: {1}
90100=No disk space available
90101=Wrong XID format: {0}
90102=Unsupported compression options: {0}
90103=Unsupported compression algorithm: {0}
...
...
h2/src/main/org/h2/res/_messages_es.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Collation no puede ser cambiado debido a que existe una tabla de datos: {0}
90090=Schema {0} no puede ser eliminado
90091=Role {0} no puede ser eliminado
90092=Esta versión de Java no esta suportada (Java 1.4 es requerida)
90093=Clustering error - la base de datos se esta corriendo en modo standalone
90094=Clustering error - la base de datos esta corriendo en modo CLUSTER, lista de servidores: {0}
90095=String con error de formato: {0}
...
...
@@ -124,7 +123,6 @@
90097=La base de datos es de solo lectura (read only)
90098=La base de datos ha sido cerrada
90099=Error setting database event listener {0}, causa: {1}
90100=No hay suficiente espacio disponible en disco
90101=Formato erroneo de XID : {0}
90102=Opciones de compresión No soportadas: {0}
90103=Algoritmo de compresión No soportado: {0}
...
...
h2/src/main/org/h2/res/_messages_ja.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=データテーブル {0} があるため、照合順序の変更はできません
90090=スキーマ {0} はドロップできません
90091=ロール {0} はドロップできません
90092=このJavaバージョンはサポートされていません (Java 1.4が必要です)
90093=クラスタリングエラー - データベースはスタンドアロンモードで動作しています
90094=クラスタリングエラー - データベースはクラスターモードで動作しています, サーバリスト: {0}
90095=文字列フォーマットエラー: {0}
...
...
@@ -124,7 +123,6 @@
90097=データベースは読み込み専用です
90098=データベースはすでに閉じられています
90099=データベースイベントリスナの設定エラー {0}
90100=ディスクの空き領域がありません
90101=不正なXIDフォーマット: {0}
90102=未サポートの圧縮オプション: {0}
90103=未サポートの圧縮アルゴリズム: {0}
...
...
h2/src/main/org/h2/res/_messages_pl.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Metoda porównywania językowego nie może być zmieniona z powodu istnienia danych w tabeli {0}
90090=Schemat {0} nie może zostać skasowany
90091=Rola {0} nie może zostać skasowana
90092=Obecna wersja Javy nie jest wspierana (Java 1.4 lub nowsza jest wymagana)
90093=Błąd klastrowania - baza obecnie pracuje w trybie autonomicznym
90094=Błąd klastrowania - baza obecnie pracuje w trybie klastra, lista serwerów: {0}
90095=Błąd ciągu formatowania: {0}
...
...
@@ -124,7 +123,6 @@
90097=Baza danych jest w trybie tylko do odczytu
90098=Baza danych została zamknięta
90099=Błąd ustawiania detektora zdarzeń bazy danych {0}, błąd: {1}
90100=Brak miejsca na dysku
90101=Zły format XID: {0}
90102=Nie wspierana opcja kompresji: {0}
90103=Nie wspierany algorytm kompresji: {0}
...
...
h2/src/main/org/h2/res/_messages_pt_br.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=A coleção não pode ser alterada, porque existe uma tabela de dados: {0}
90090=Esquema {0} não pode ser apagado
90091=Regra {0} não pode ser apagada
90092=Esta versão do Java não é suportada (Java 1.4 é requerido no mínimo)
90093=Erro de clusterização - base de dados rodando no modo standalone no momento
90094=Erro de clusterização - base de dados rodando no modo cluster, lista do servidor: {0}
90095=Erro no formato da string: {0}
...
...
@@ -124,7 +123,6 @@
90097=Base de dados é somente leitura
90098=Base de dados foi fechada
90099=Erro na definição do evento listener {0} da base de dados, causa: {1}
90100=Não há espaço em disco suficiente
90101=Formato XID incorreto: {0}
90102=Não é suportado as opções de compressão: {0}
90103=Não é suportado o algorítimo de compressão: {0}
...
...
h2/src/main/org/h2/res/_messages_ru.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Невозможно изменить collation, пока есть данные в таблицах: {0}
90090=Схема {0} не может быть удалена
90091=Роль {0} не может быть удалена
90092=Данная версия Java не поддерживается (минимальная поддерживаемая версия Java 1.4)
90093=Ошибка кластеризации - база данных работает в одиночном режиме
90094=Ошибка кластеризации - база данных работает в кластерном режиме, список серверов: {0}
90095=Ошибка формата строкового литерала: {0}
...
...
@@ -124,7 +123,6 @@
90097=База данных доступна только на чтение
90098=База данных уже закрыта
90099=Ошибка при установке слушателя событий базы данных {0}, причина: {1}
90100=Недостаточно места на диске
90101=Некорректный XID формат: {0}
90102=Неподдерживаемые опции сжатия: {0}
90103=Неподдерживаемый алгоритм сжатия: {0}
...
...
h2/src/main/org/h2/res/_messages_sk.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=Kolácia (collation) nemôže byť zmenená pretože tu je dátová tabuľka: {0}
90090=Schéma {0} nemôže byť zmazaná
90091=Rola {0} nemôže byť zmazaná
90092=Táto verzia Javy nie je podporovaná (Min. Java 1.4 je požadovaná)
90093=Chyba klustra - databáza je teraz v nezáviaslom (standalone) móde
90094=Chyba klustra - databáza je teraz v kluster móde, zoznam serverov: {0}
90095=Chyba formátu reťazca: {0}
...
...
@@ -124,7 +123,6 @@
90097=Databáza je iba na čítanie
90098=Databáza bola zatvorená
90099=Chyba nastavenia poslucháča udalostí (event listener) {0} pre databázu, dôvod: {1}
90100=Málo miesta na disku
90101=Nesprávny XID formát: {0}
90102=Nepodporované prepínače kompresie: {0}
90103=Nepodporovaný algoritmus kompresie: {0}
...
...
h2/src/main/org/h2/res/_messages_zh_cn.prop
浏览文件 @
3c7e2241
...
...
@@ -116,7 +116,6 @@
90089=不能变更整理(Collation),因为存在一个数据表: {0}
90090=不能删除方案(schema) {0}
90091=不能删除角色 {0}
90092=不支持这个 Java 版本 (至少需要Java 1.4 )
90093=集群错误 - 数据库现在运行在独立运行模式
90094=集群错误 - 数据库现在运行在集群模式, 服务器列表: {0}
90095=字符串格式错误: {0}
...
...
@@ -124,7 +123,6 @@
90097=数据库为只读
90098=数据库已关闭
90099=设立数据库事件监听器错误 {0}, 原因: {1}
90100=磁盘没有有效空间
90101=错误的 XID 格式: {0}
90102=不支持的压缩选项: {0}
90103=不支持的压缩算法: {0}
...
...
h2/src/main/org/h2/result/ResultDiskBuffer.java
deleted
100644 → 0
浏览文件 @
a2bb8c17
/*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
result
;
import
java.io.ByteArrayOutputStream
;
import
java.util.ArrayList
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Database
;
import
org.h2.engine.Session
;
import
org.h2.message.DbException
;
import
org.h2.store.Data
;
import
org.h2.store.FileStore
;
import
org.h2.util.New
;
import
org.h2.value.Value
;
/**
* This class implements the disk buffer for the LocalResult class.
*/
class
ResultDiskBuffer
implements
ResultExternal
{
private
static
final
int
READ_AHEAD
=
128
;
private
final
Data
rowBuff
;
private
final
ArrayList
<
ResultDiskTape
>
tapes
;
private
final
ResultDiskTape
mainTape
;
private
final
SortOrder
sort
;
private
final
int
columnCount
;
private
final
int
maxBufferSize
;
private
FileStore
file
;
private
int
rowCount
;
private
final
ResultDiskBuffer
parent
;
private
boolean
closed
;
private
int
childCount
;
/**
* Represents a virtual disk tape for the merge sort algorithm.
* Each virtual disk tape is a region of the temp file.
*/
static
class
ResultDiskTape
{
/**
* The start position of this tape in the file.
*/
long
start
;
/**
* The end position of this tape in the file.
*/
long
end
;
/**
* The current read position.
*/
long
pos
;
/**
* A list of rows in the buffer.
*/
ArrayList
<
Value
[]>
buffer
=
New
.
arrayList
();
}
ResultDiskBuffer
(
Session
session
,
SortOrder
sort
,
int
columnCount
)
{
this
.
parent
=
null
;
this
.
sort
=
sort
;
this
.
columnCount
=
columnCount
;
Database
db
=
session
.
getDatabase
();
rowBuff
=
Data
.
create
(
db
,
Constants
.
DEFAULT_PAGE_SIZE
);
String
fileName
=
db
.
createTempFile
();
file
=
db
.
openFile
(
fileName
,
"rw"
,
false
);
file
.
setCheckedWriting
(
false
);
file
.
seek
(
FileStore
.
HEADER_LENGTH
);
if
(
sort
!=
null
)
{
tapes
=
New
.
arrayList
();
mainTape
=
null
;
}
else
{
tapes
=
null
;
mainTape
=
new
ResultDiskTape
();
mainTape
.
pos
=
FileStore
.
HEADER_LENGTH
;
}
this
.
maxBufferSize
=
db
.
getSettings
().
largeResultBufferSize
;
}
private
ResultDiskBuffer
(
ResultDiskBuffer
parent
)
{
this
.
parent
=
parent
;
rowBuff
=
Data
.
create
(
parent
.
rowBuff
.
getHandler
(),
Constants
.
DEFAULT_PAGE_SIZE
);
file
=
parent
.
file
;
if
(
parent
.
tapes
!=
null
)
{
tapes
=
New
.
arrayList
();
for
(
ResultDiskTape
t
:
parent
.
tapes
)
{
ResultDiskTape
t2
=
new
ResultDiskTape
();
t2
.
pos
=
t2
.
start
=
t
.
start
;
t2
.
end
=
t
.
end
;
tapes
.
add
(
t2
);
}
}
else
{
tapes
=
null
;
}
if
(
parent
.
mainTape
!=
null
)
{
mainTape
=
new
ResultDiskTape
();
mainTape
.
pos
=
FileStore
.
HEADER_LENGTH
;
mainTape
.
start
=
parent
.
mainTape
.
start
;
mainTape
.
end
=
parent
.
mainTape
.
end
;
}
else
{
mainTape
=
null
;
}
sort
=
parent
.
sort
;
columnCount
=
parent
.
columnCount
;
maxBufferSize
=
parent
.
maxBufferSize
;
}
@Override
public
synchronized
ResultDiskBuffer
createShallowCopy
()
{
if
(
closed
||
parent
!=
null
)
{
return
null
;
}
childCount
++;
return
new
ResultDiskBuffer
(
this
);
}
@Override
public
int
addRows
(
ArrayList
<
Value
[]>
rows
)
{
if
(
sort
!=
null
)
{
sort
.
sort
(
rows
);
}
Data
buff
=
rowBuff
;
long
start
=
file
.
getFilePointer
();
ByteArrayOutputStream
buffer
=
new
ByteArrayOutputStream
();
int
bufferLen
=
0
;
for
(
Value
[]
row
:
rows
)
{
buff
.
reset
();
buff
.
writeInt
(
0
);
for
(
int
j
=
0
;
j
<
columnCount
;
j
++)
{
Value
v
=
row
[
j
];
buff
.
checkCapacity
(
buff
.
getValueLen
(
v
));
buff
.
writeValue
(
v
);
}
buff
.
fillAligned
();
int
len
=
buff
.
length
();
buff
.
setInt
(
0
,
len
);
if
(
maxBufferSize
>
0
)
{
buffer
.
write
(
buff
.
getBytes
(),
0
,
len
);
bufferLen
+=
len
;
if
(
bufferLen
>
maxBufferSize
)
{
byte
[]
data
=
buffer
.
toByteArray
();
buffer
.
reset
();
file
.
write
(
data
,
0
,
data
.
length
);
bufferLen
=
0
;
}
}
else
{
file
.
write
(
buff
.
getBytes
(),
0
,
len
);
}
}
if
(
bufferLen
>
0
)
{
byte
[]
data
=
buffer
.
toByteArray
();
file
.
write
(
data
,
0
,
data
.
length
);
}
if
(
sort
!=
null
)
{
ResultDiskTape
tape
=
new
ResultDiskTape
();
tape
.
start
=
start
;
tape
.
end
=
file
.
getFilePointer
();
tapes
.
add
(
tape
);
}
else
{
mainTape
.
end
=
file
.
getFilePointer
();
}
rowCount
+=
rows
.
size
();
return
rowCount
;
}
@Override
public
void
done
()
{
file
.
seek
(
FileStore
.
HEADER_LENGTH
);
file
.
autoDelete
();
}
@Override
public
void
reset
()
{
if
(
sort
!=
null
)
{
for
(
ResultDiskTape
tape
:
tapes
)
{
tape
.
pos
=
tape
.
start
;
tape
.
buffer
=
New
.
arrayList
();
}
}
else
{
mainTape
.
pos
=
FileStore
.
HEADER_LENGTH
;
mainTape
.
buffer
=
New
.
arrayList
();
}
}
private
void
readRow
(
ResultDiskTape
tape
)
{
int
min
=
Constants
.
FILE_BLOCK_SIZE
;
Data
buff
=
rowBuff
;
buff
.
reset
();
file
.
readFully
(
buff
.
getBytes
(),
0
,
min
);
int
len
=
buff
.
readInt
();
buff
.
checkCapacity
(
len
);
if
(
len
-
min
>
0
)
{
file
.
readFully
(
buff
.
getBytes
(),
min
,
len
-
min
);
}
tape
.
pos
+=
len
;
Value
[]
row
=
new
Value
[
columnCount
];
for
(
int
k
=
0
;
k
<
columnCount
;
k
++)
{
row
[
k
]
=
buff
.
readValue
();
}
tape
.
buffer
.
add
(
row
);
}
@Override
public
Value
[]
next
()
{
return
sort
!=
null
?
nextSorted
()
:
nextUnsorted
();
}
private
Value
[]
nextUnsorted
()
{
file
.
seek
(
mainTape
.
pos
);
if
(
mainTape
.
buffer
.
size
()
==
0
)
{
for
(
int
j
=
0
;
mainTape
.
pos
<
mainTape
.
end
&&
j
<
READ_AHEAD
;
j
++)
{
readRow
(
mainTape
);
}
}
Value
[]
row
=
mainTape
.
buffer
.
get
(
0
);
mainTape
.
buffer
.
remove
(
0
);
return
row
;
}
private
Value
[]
nextSorted
()
{
int
next
=
-
1
;
for
(
int
i
=
0
,
size
=
tapes
.
size
();
i
<
size
;
i
++)
{
ResultDiskTape
tape
=
tapes
.
get
(
i
);
if
(
tape
.
buffer
.
size
()
==
0
&&
tape
.
pos
<
tape
.
end
)
{
file
.
seek
(
tape
.
pos
);
for
(
int
j
=
0
;
tape
.
pos
<
tape
.
end
&&
j
<
READ_AHEAD
;
j
++)
{
readRow
(
tape
);
}
}
if
(
tape
.
buffer
.
size
()
>
0
)
{
if
(
next
==
-
1
)
{
next
=
i
;
}
else
if
(
compareTapes
(
tape
,
tapes
.
get
(
next
))
<
0
)
{
next
=
i
;
}
}
}
ResultDiskTape
t
=
tapes
.
get
(
next
);
Value
[]
row
=
t
.
buffer
.
get
(
0
);
t
.
buffer
.
remove
(
0
);
return
row
;
}
private
int
compareTapes
(
ResultDiskTape
a
,
ResultDiskTape
b
)
{
Value
[]
va
=
a
.
buffer
.
get
(
0
);
Value
[]
vb
=
b
.
buffer
.
get
(
0
);
return
sort
.
compare
(
va
,
vb
);
}
private
synchronized
void
closeChild
()
{
if
(--
childCount
==
0
&&
closed
)
{
file
.
closeAndDeleteSilently
();
file
=
null
;
}
}
@Override
protected
void
finalize
()
{
close
();
}
@Override
public
synchronized
void
close
()
{
if
(
closed
)
{
return
;
}
closed
=
true
;
if
(
parent
!=
null
)
{
parent
.
closeChild
();
}
else
if
(
file
!=
null
)
{
if
(
childCount
==
0
)
{
file
.
closeAndDeleteSilently
();
file
=
null
;
}
}
}
@Override
public
int
removeRow
(
Value
[]
values
)
{
throw
DbException
.
throwInternalError
();
}
@Override
public
boolean
contains
(
Value
[]
values
)
{
throw
DbException
.
throwInternalError
();
}
@Override
public
int
addRow
(
Value
[]
values
)
{
throw
DbException
.
throwInternalError
();
}
}
h2/src/main/org/h2/store/fs/FilePath.java
浏览文件 @
3c7e2241
...
...
@@ -321,35 +321,4 @@ public abstract class FilePath {
return
this
;
}
/**
* The options to open a file.
*/
public
enum
FileOpenOption
{
/**
* Append at the end of the file.
*/
APPEND
,
/**
* Written data is not buffered.
*/
DSYNC
,
/**
* Open the file for read access.
*/
READ
,
/**
* Written data and metadata is not buffered.
*/
SYNC
,
/**
* Open the file for write access.
*/
WRITE
,
}
}
h2/src/main/org/h2/store/fs/Recorder.java
浏览文件 @
3c7e2241
...
...
@@ -11,17 +11,6 @@ package org.h2.store.fs;
*/
public
interface
Recorder
{
/**
* Copy a file. The file name contains the source and the target file
* separated with a colon.
*/
int
COPY
=
0
;
/**
* Create a directory.
*/
int
CREATE_DIRECTORY
=
1
;
/**
* Create a new file.
*/
...
...
h2/src/main/org/h2/value/ValueGeometry.java
浏览文件 @
3c7e2241
...
...
@@ -181,26 +181,6 @@ public class ValueGeometry extends Value {
return
get
(
gf
.
toGeometry
(
mergedEnvelope
));
}
/**
* Get the intersection.
*
* @param r the other geometry
* @return the intersection of this geometry envelope and another
*/
public
ValueGeometry
getEnvelopeIntersection
(
ValueGeometry
r
)
{
Envelope
e1
=
getGeometryNoCopy
().
getEnvelopeInternal
();
Envelope
e2
=
r
.
getGeometryNoCopy
().
getEnvelopeInternal
();
Envelope
e3
=
e1
.
intersection
(
e2
);
// try to re-use the object
if
(
e3
==
e1
)
{
return
this
;
}
else
if
(
e3
==
e2
)
{
return
r
;
}
GeometryFactory
gf
=
new
GeometryFactory
();
return
get
(
gf
.
toGeometry
(
e3
));
}
@Override
public
int
getType
()
{
return
Value
.
GEOMETRY
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论