Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-5483: SQL: Added limited support for Java8 LocalDateTime #2248

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a5abdd5
ignite-2.1 Fixed minor issues and typos.
vsisko Jul 4, 2017
6c9d222
ignite-2.1 Added persistent store metrics.
akuznetsov-os Jul 4, 2017
f391290
IGNITE-5527: Prevent starvation in stripe pool on unstable topology.
AMashenkov Jun 16, 2017
b69f53e
IGNITE-5629 .NET: CacheConfiguration copy constructor
ptupitsyn Jul 4, 2017
2e7adbf
ignite-5685 JDBC prepared statement shouldn't clear parameters after …
Jul 4, 2017
9743fa3
Muted hanging tests.
ilantukh Jul 4, 2017
114c42e
Cosmetic changes
agoncharuk Jul 4, 2017
77c5dc7
Added onCacheGroupStopped callback
dgovorukhin Jul 4, 2017
ee7566b
Minor code cleanup
dgovorukhin Jul 4, 2017
44f3fac
IGNITE-5558 - Added ability to read WAL in standalone mode - Fixes #2…
Jul 4, 2017
90b67fa
IGNITE-4536 two tests unmuted, one test removed as obsolete (IGNITE-5…
sergey-chugunov-1985 Jul 4, 2017
50bb090
Muted hanging tests.
ilantukh Jul 4, 2017
5b7165c
IGNITE-5693 - Fixed semaphore flaky test - Fixes #2239.
ilantukh Jul 4, 2017
54572c3
IGNITE-5340: Improved IgniteCacheAbstractQuerySelfTest to better test…
Jul 5, 2017
44fad24
IGNITE-5426: JdbcThinConnection.readOnly state propagation. This clos…
Jul 5, 2017
1337901
Reworked cluster activation/deactivation.
sboikov Jul 5, 2017
b67b8c4
Merge remote-tracking branch 'origin/ignite-2.1' into ignite-2.1
sboikov Jul 5, 2017
f9f13cf
IGNITE-5605 .NET: Inject resources into remote event filters
ptupitsyn Jul 5, 2017
aa21a9b
Merge branch 'ignite-2.1' into ignite-2.1.2
Jul 5, 2017
301f310
IGNITE-5663: ODBC: Closing cursor do not reset prepared statement any…
isapego Jul 4, 2017
58a937e
Diagnostic info for GridDhtTxFinishFuture.
sboikov Jul 5, 2017
0f9a895
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
sboikov Jul 5, 2017
15da654
IGNITE-5187: Improved DynamicIndexAbstractConcurrentSelfTest reliabil…
alexpaschenko Jul 5, 2017
0357c51
ignite-2.1 Do not use 'compress' flag for GridDhtPartitionsFullMessag…
sboikov Jul 5, 2017
7504b38
ignite-2.1 Do not use 'compress' flag for GridDhtPartitionsFullMessag…
sboikov Jul 5, 2017
ad42f62
ignite-2.1
sboikov Jul 5, 2017
29d532e
IGNITE-5576: Added Compute::Run() for C++
isapego Jul 5, 2017
905e34d
Added onActivate/onDeactivate callbacks for plugins
dgovorukhin Jul 5, 2017
6abfa6e
IGNITE-5483: Added limited support for Java8 LocalDateTime
skalashnikov Jul 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,41 @@ public class JdbcPreparedStatementSelfTest extends GridCommonAbstractTest {
}
}

/**
* @throws Exception If failed.
*/
public void testRepeatableUsage() throws Exception {
stmt = conn.prepareStatement("select * from TestObject where id = ?");

stmt.setInt(1, 1);

ResultSet rs = stmt.executeQuery();

int cnt = 0;

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);

cnt = 0;

rs = stmt.executeQuery();

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);
}

/**
* @throws Exception If failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,41 @@ public class JdbcPreparedStatementSelfTest extends GridCommonAbstractTest {
}
}

/**
* @throws Exception If failed.
*/
public void testRepeatableUsage() throws Exception {
stmt = conn.prepareStatement("select * from TestObject where id = ?");

stmt.setInt(1, 1);

ResultSet rs = stmt.executeQuery();

int cnt = 0;

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);

cnt = 0;

rs = stmt.executeQuery();

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);
}

/**
* @throws Exception If failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,41 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest
}
}

/**
* @throws Exception If failed.
*/
public void testRepeatableUsage() throws Exception {
stmt = conn.prepareStatement(SQL_PART + " where id = ?");

stmt.setInt(1, 1);

ResultSet rs = stmt.executeQuery();

int cnt = 0;

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);

cnt = 0;

rs = stmt.executeQuery();

while (rs.next()) {
if (cnt == 0)
assertEquals(1, rs.getInt(1));

cnt++;
}

assertEquals(1, cnt);
}

/**
* @throws Exception If failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class PersistentStoreConfiguration implements Serializable {
/** */
public static final int DFLT_WAL_SEGMENTS = 10;

/** */
/** Default WAL file segment size, 64MBytes */
public static final int DFLT_WAL_SEGMENT_SIZE = 64 * 1024 * 1024;

/** Default wal mode. */
Expand Down Expand Up @@ -103,10 +103,10 @@ public class PersistentStoreConfiguration implements Serializable {
/** Number of work WAL segments. */
private int walSegments = DFLT_WAL_SEGMENTS;

/** Number of WAL segments to keep. */
/** Size of one WAL segment in bytes. 64 Mb is used by default. Maximum value is 2Gb */
private int walSegmentSize = DFLT_WAL_SEGMENT_SIZE;

/** WAL persistence path. */
/** Directory where WAL is stored (work directory) */
private String walStorePath = DFLT_WAL_STORE_PATH;

/** WAL archive path. */
Expand All @@ -121,7 +121,7 @@ public class PersistentStoreConfiguration implements Serializable {
/** WAl thread local buffer size. */
private int tlbSize = DFLT_TLB_SIZE;

/** Wal flush frequency. */
/** Wal flush frequency in milliseconds. */
private int walFlushFreq = DFLT_WAL_FLUSH_FREQ;

/** Wal fsync delay. */
Expand All @@ -146,6 +146,11 @@ public class PersistentStoreConfiguration implements Serializable {
/** Time interval (in milliseconds) for rate-based metrics. */
private long rateTimeInterval = DFLT_RATE_TIME_INTERVAL_MILLIS;

/**
* Time interval (in milliseconds) for running auto archiving for incompletely WAL segment
*/
private long walAutoArchiveAfterInactivity = -1;

/**
* Returns a path the root directory where the Persistent Store will persist data and indexes.
*/
Expand Down Expand Up @@ -297,7 +302,7 @@ public PersistentStoreConfiguration setWalSegments(int walSegments) {
}

/**
* Gets size of a WAL segment.
* Gets size of a WAL segment in bytes.
*
* @return WAL segment size.
*/
Expand All @@ -308,7 +313,7 @@ public int getWalSegmentSize() {
/**
* Sets size of a WAL segment.
*
* @param walSegmentSize WAL segment size. 64 MB is used by default.
* @param walSegmentSize WAL segment size. 64 MB is used by default. Maximum value is 2Gb
* @return {@code this} for chaining.
*/
public PersistentStoreConfiguration setWalSegmentSize(int walSegmentSize) {
Expand Down Expand Up @@ -533,6 +538,28 @@ public PersistentStoreConfiguration setAlwaysWriteFullPages(boolean alwaysWriteF
return this;
}

/**
* <b>Note:</b> setting this value with {@link WALMode#DEFAULT} may generate file size overhead for WAL segments in case
* grid is used rarely.
*
* @param walAutoArchiveAfterInactivity time in millis to run auto archiving segment (even if incomplete) after last
* record logging. <br> Positive value enables incomplete segment archiving after timeout (inactivity). <br> Zero or
* negative value disables auto archiving.
* @return current configuration instance for chaining
*/
public PersistentStoreConfiguration setWalAutoArchiveAfterInactivity(long walAutoArchiveAfterInactivity) {
this.walAutoArchiveAfterInactivity = walAutoArchiveAfterInactivity;

return this;
}

/**
* @return time in millis to run auto archiving WAL segment (even if incomplete) after last record log
*/
public long getWalAutoArchiveAfterInactivity() {
return walAutoArchiveAfterInactivity;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(PersistentStoreConfiguration.class, this);
Expand Down
12 changes: 12 additions & 0 deletions modules/core/src/main/java/org/apache/ignite/events/EventType.java
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,18 @@ public interface EventType {
*/
public static final int EVT_IGFS_FILE_PURGED = 127;

/**
* Built-in event type: WAL segment movement to archive folder completed
* <p>
* Fired for each completed WAL segment which was moved to archive
* <p>
* NOTE: all types in range <b>from 1 to 1000 are reserved</b> for
* internal Ignite events and should not be used by user-defined events.
*
* @see WalSegmentArchivedEvent
*/
public static final int EVT_WAL_SEGMENT_ARCHIVED = 128;

/**
* All checkpoint events. This array can be directly passed into
* {@link IgniteEvents#localListen(IgnitePredicate, int...)} method to
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ignite.events;

import java.io.File;
import org.apache.ignite.cluster.ClusterNode;
import org.jetbrains.annotations.NotNull;

/**
* Event indicates there was movement of WAL segment file to archive has been completed
*/
public class WalSegmentArchivedEvent extends EventAdapter {
/** */
private static final long serialVersionUID = 0L;

/** Absolute WAL segment file index. */
private long absWalSegmentIdx;

/** Destination archive file. This file is completed and closed archive segment */
private final File archiveFile;

/**
* Creates WAL segment event
*
* @param node Node.
* @param absWalSegmentIdx Absolute wal segment index.
* @param archiveFile Archive file.
*/
public WalSegmentArchivedEvent(
@NotNull final ClusterNode node,
final long absWalSegmentIdx,
final File archiveFile) {
super(node, "", EventType.EVT_WAL_SEGMENT_ARCHIVED);
this.absWalSegmentIdx = absWalSegmentIdx;
this.archiveFile = archiveFile;
}

/** @return {@link #archiveFile} */
public File getArchiveFile() {
return archiveFile;
}

/** @return {@link #absWalSegmentIdx} */
public long getAbsWalSegmentIdx() {
return absWalSegmentIdx;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ enum DiscoveryDataExchangeType {
* Callback that notifies that kernal has successfully started,
* including all managers and processors.
*
* @param active Cluster active flag (note: should be used carefully since state can
* change concurrently).
* @throws IgniteCheckedException Thrown in case of any errors.
*/
public void onKernalStart() throws IgniteCheckedException;
public void onKernalStart(boolean active) throws IgniteCheckedException;

/**
* Callback to notify that kernal is about to stop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public PluginProvider plugin() {
}

/** {@inheritDoc} */
@Override public void onKernalStart() throws IgniteCheckedException {
@Override public void onKernalStart(boolean active) throws IgniteCheckedException {
plugin.onIgniteStart();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ public final static class TxInfoClosure extends DiagnosticBaseClosure {
for (IgniteInternalTx tx : ctx.cache().context().tm().activeTransactions()) {
if (dhtVer.equals(tx.xidVersion()) || nearVer.equals(tx.nearXidVersion())) {
sb.append(U.nl())
.append(" [ver=").append(tx.xidVersion())
.append(" ")
.append(tx.getClass().getSimpleName())
.append(" [ver=").append(tx.xidVersion())
.append(", nearVer=").append(tx.nearXidVersion())
.append(", topVer=").append(tx.topologyVersion())
.append(", state=").append(tx.state())
Expand Down
Loading