Author: shawkins
Date: 2010-07-07 13:10:31 -0400 (Wed, 07 Jul 2010)
New Revision: 2330
Modified:
trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java
trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
Log:
TEIID-1145 fix for vdb truncation.
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-07-07
01:34:45 UTC (rev 2329)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-07-07
17:10:31 UTC (rev 2330)
@@ -26,7 +26,6 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Properties;
@@ -37,7 +36,6 @@
import org.teiid.adminapi.Admin;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminFactory;
-import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.ProcessObject;
import org.teiid.adminapi.PropertyDefinition;
import org.teiid.adminapi.Request;
@@ -47,7 +45,6 @@
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.WorkerPoolStatistics;
import org.teiid.adminshell.Help.Doc;
-import org.teiid.core.util.ObjectConverterUtil;
/**
@@ -302,13 +299,13 @@
return false;
}
- private static void writeFile(String deployedName, String fileName,
+ /*private static void writeFile(String deployedName, String fileName,
InputStream contents) throws IOException, AdminProcessingException {
if (contents == null) {
throw new AdminProcessingException(deployedName + " not found for
exporting");//$NON-NLS-1$
}
ObjectConverterUtil.write(contents, fileName);
- }
+ }*/
@Doc(text = "Deploy a VDB from file")
public static void deployVDB(
Modified: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml 2010-07-07 01:34:45 UTC (rev
2329)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2010-07-07 17:10:31 UTC (rev
2330)
@@ -1,4 +1,3 @@
-<!--This script builds a JAR for the CDK -->
<assembly>
<id>adminshell-dist</id>
Modified:
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
===================================================================
---
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-07-07
01:34:45 UTC (rev 2329)
+++
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-07-07
17:10:31 UTC (rev 2330)
@@ -63,7 +63,7 @@
out.writeInt(baos.getCount()); //includes the lob references
out.write(baos.getBuffer(), 0, baos.getCount());
- byte[] chunk = new byte[1 << 16];
+ byte[] chunk = new byte[(1 << 16) - 1];
for (InputStream is : oout.getStreams()) {
while (true) {
int bytes = is.read(chunk);
Modified: trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java 2010-07-07 01:34:45
UTC (rev 2329)
+++ trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java 2010-07-07 17:10:31
UTC (rev 2330)
@@ -63,7 +63,7 @@
@ChannelPipelineCoverage("all")
public class ObjectEncoder implements ChannelDownstreamHandler {
private static final byte[] LENGTH_PLACEHOLDER = new byte[4];
- private static final int CHUNK_SIZE = 1 << 16;
+ private static final int CHUNK_SIZE = (1 << 16) - 1;
private final int estimatedLength;
Modified: trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-07-07
01:34:45 UTC (rev 2329)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-07-07
17:10:31 UTC (rev 2330)
@@ -128,6 +128,7 @@
FakeService fs = conn.getService(FakeService.class);
assertEquals(150, fs.lobMethod(new ByteArrayInputStream(new byte[100]), new
StringReader(new String(new char[50]))));
assertEquals(0, fs.lobMethod(new ByteArrayInputStream(new byte[0]), new
StringReader(new String(new char[0]))));
+ assertEquals((1 << 17) + 50, fs.lobMethod(new ByteArrayInputStream(new byte[1
<< 17]), new StringReader(new String(new char[50]))));
}
@Test public void testServerRemoteStreaming() throws Exception {