-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#768 Improve write performance of blob by writing directly from arrays
When possible, we ignore the blobBufferSize.
- Loading branch information
1 parent
f0d61a7
commit c7c8bd8
Showing
22 changed files
with
985 additions
and
1,221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/jna-test/org/firebirdsql/gds/ng/jna/JnaBlobInputTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Firebird Open Source JDBC Driver | ||
* | ||
* Distributable under LGPL license. | ||
* You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* LGPL License for more details. | ||
* | ||
* This file was created by members of the firebird development team. | ||
* All individual contributions remain the Copyright (C) of those | ||
* individuals. Contributors to this file are either listed here or | ||
* can be obtained from a source control history command. | ||
* | ||
* All rights reserved. | ||
*/ | ||
package org.firebirdsql.gds.ng.jna; | ||
|
||
import org.firebirdsql.common.FBTestProperties; | ||
import org.firebirdsql.common.extension.GdsTypeExtension; | ||
import org.firebirdsql.gds.ng.BaseTestBlob; | ||
import org.firebirdsql.gds.ng.FbConnectionProperties; | ||
import org.junit.jupiter.api.Order; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.sql.SQLException; | ||
|
||
/** | ||
* Test for input blobs in the JNA implementation. | ||
* | ||
* @author Mark Rotteveel | ||
*/ | ||
class JnaBlobInputTest extends BaseTestBlob { | ||
|
||
@RegisterExtension | ||
@Order(1) | ||
public static final GdsTypeExtension testType = GdsTypeExtension.supportsNativeOnly(); | ||
|
||
private final AbstractNativeDatabaseFactory factory = | ||
(AbstractNativeDatabaseFactory) FBTestProperties.getFbDatabaseFactory(); | ||
|
||
@Override | ||
protected JnaDatabase createFbDatabase(FbConnectionProperties connectionInfo) throws SQLException { | ||
final JnaDatabase db = factory.connect(connectionInfo); | ||
db.attach(); | ||
return db; | ||
} | ||
|
||
@Override | ||
protected JnaDatabase createDatabaseConnection() throws SQLException { | ||
return (JnaDatabase) super.createDatabaseConnection(); | ||
} | ||
|
||
} |
55 changes: 55 additions & 0 deletions
55
src/jna-test/org/firebirdsql/gds/ng/jna/JnaBlobOutputTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Firebird Open Source JDBC Driver | ||
* | ||
* Distributable under LGPL license. | ||
* You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* LGPL License for more details. | ||
* | ||
* This file was created by members of the firebird development team. | ||
* All individual contributions remain the Copyright (C) of those | ||
* individuals. Contributors to this file are either listed here or | ||
* can be obtained from a source control history command. | ||
* | ||
* All rights reserved. | ||
*/ | ||
package org.firebirdsql.gds.ng.jna; | ||
|
||
import org.firebirdsql.common.FBTestProperties; | ||
import org.firebirdsql.common.extension.GdsTypeExtension; | ||
import org.firebirdsql.gds.ng.BaseTestOutputBlob; | ||
import org.firebirdsql.gds.ng.FbConnectionProperties; | ||
import org.junit.jupiter.api.Order; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.sql.SQLException; | ||
|
||
/** | ||
* Test for output blobs in the JNA implementation. | ||
* | ||
* @author Mark Rotteveel | ||
*/ | ||
class JnaBlobOutputTest extends BaseTestOutputBlob { | ||
|
||
@RegisterExtension | ||
@Order(1) | ||
public static final GdsTypeExtension testType = GdsTypeExtension.supportsNativeOnly(); | ||
|
||
private final AbstractNativeDatabaseFactory factory = | ||
(AbstractNativeDatabaseFactory) FBTestProperties.getFbDatabaseFactory(); | ||
|
||
@Override | ||
protected JnaDatabase createFbDatabase(FbConnectionProperties connectionInfo) throws SQLException { | ||
final JnaDatabase db = factory.connect(connectionInfo); | ||
db.attach(); | ||
return db; | ||
} | ||
|
||
@Override | ||
protected JnaDatabase createDatabaseConnection() throws SQLException { | ||
return (JnaDatabase) super.createDatabaseConnection(); | ||
} | ||
} |
Oops, something went wrong.