Skip to content

Commit

Permalink
blob handling is too slow #235
Browse files Browse the repository at this point in the history
  • Loading branch information
abstratt committed Sep 4, 2017
1 parent 1f673cb commit eee349d
Show file tree
Hide file tree
Showing 33 changed files with 768 additions and 67 deletions.
2 changes: 1 addition & 1 deletion kirra-mdd/com.abstratt.kirra.mdd.core/models/kirra.uml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0" name="kirra" URI="models/kirra" metamodelReference="_packageImport.0">
<eAnnotations xmi:id="_com.abstratt2Fmdd2F" source="com.abstratt/mdd/">
<details xmi:id="_com.abstratt2Fmdd2F-_details.0" key="dateCreated" value="2017/05/19 02:40:51 188 -0300"/>
<details xmi:id="_com.abstratt2Fmdd2F-_details.0" key="dateCreated" value="2017/08/22 11:52:16 825 -0300"/>
</eAnnotations>
<eAnnotations xmi:id="_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML" source="http://www.eclipse.org/uml2/2.0.0/UML">
<contents xmi:type="ecore:EPackage" xmi:id="_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-kirra" name="kirra" nsURI="models/kirra" nsPrefix="kirra">
Expand Down
3 changes: 3 additions & 0 deletions kirra-mdd/com.abstratt.kirra.mdd.core/models/userprofile.tuml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ class Profile specializes SystemUser
*/
end;

role class Anonymous
end;

end.
26 changes: 18 additions & 8 deletions kirra-mdd/com.abstratt.kirra.mdd.core/models/userprofile.uml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:mdd_extensions="profiles/mdd_extensions" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="profiles/mdd_extensions pathmap://MDD_PROFILES/mdd_extensions.uml#_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-mdd_extensions">
<uml:Package xmi:id="_0" name="userprofile" URI="models/userprofile">
<eAnnotations xmi:id="_com.abstratt2Fmdd2F" source="com.abstratt/mdd/">
<details xmi:id="_com.abstratt2Fmdd2F-_details.0" key="dateCreated" value="2017/05/19 02:40:51 221 -0300"/>
<details xmi:id="_com.abstratt2Fmdd2F-_details.0" key="dateCreated" value="2017/08/22 11:52:16 969 -0300"/>
</eAnnotations>
<packageImport xmi:id="_packageImport.0">
<importedPackage xmi:type="uml:Model" href="pathmap://MDD_LIBRARIES/mdd_types.uml#_0"/>
Expand Down Expand Up @@ -78,6 +78,14 @@
</structuredNode>
</ownedBehavior>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="Anonymous" name="Anonymous">
<eAnnotations xmi:id="Anonymous-_com.abstratt2Fmdd2Funit" source="com.abstratt/mdd/unit">
<details xmi:id="Anonymous-_com.abstratt2Fmdd2Funit-_details.0" key="name" value="userprofile.tuml"/>
</eAnnotations>
<generalization xmi:id="Anonymous-_generalization.0">
<general xmi:type="uml:Class" href="pathmap://MDD_LIBRARIES/mdd_types.uml#Object"/>
</generalization>
</packagedElement>
<profileApplication xmi:id="_profileApplication.0">
<eAnnotations xmi:id="_profileApplication.0-_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="pathmap://MDD_PROFILES/mdd_extensions.uml#_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-mdd_extensions"/>
Expand All @@ -94,13 +102,15 @@
<mdd_extensions:Debuggable xmi:id="_1" lineNumber="7" source="userprofile.tuml" base_Element="Profile"/>
<mdd_extensions:Debuggable xmi:id="_2" lineNumber="10" source="userprofile.tuml" base_Element="Profile-username"/>
<mdd_extensions:Debuggable xmi:id="_3" lineNumber="11" source="userprofile.tuml" base_Element="Profile-password"/>
<mdd_extensions:Application xmi:id="_4" base_Package="_0"/>
<mdd_extensions:Access xmi:id="_5" base_Constraint="Profile-_ownedRule.0"/>
<mdd_extensions:Debuggable xmi:id="_6" lineNumber="8" source="userprofile.tuml" base_Element="Profile-_ownedRule.0"/>
<mdd_extensions:ConstraintBehavior xmi:id="_7" constraint="Profile-_ownedRule.0" base_Activity="Profile-_ownedBehavior.0"/>
<mdd_extensions:BasicValue xmi:id="_8" base_LiteralString="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.1-_value">
<mdd_extensions:Debuggable xmi:id="_4" lineNumber="20" source="userprofile.tuml" base_Element="Anonymous"/>
<mdd_extensions:Role xmi:id="_5" base_Class="Anonymous"/>
<mdd_extensions:Application xmi:id="_6" base_Package="_0"/>
<mdd_extensions:Access xmi:id="_7" base_Constraint="Profile-_ownedRule.0"/>
<mdd_extensions:Debuggable xmi:id="_8" lineNumber="8" source="userprofile.tuml" base_Element="Profile-_ownedRule.0"/>
<mdd_extensions:ConstraintBehavior xmi:id="_9" constraint="Profile-_ownedRule.0" base_Activity="Profile-_ownedBehavior.0"/>
<mdd_extensions:BasicValue xmi:id="_10" base_LiteralString="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.1-_value">
<basicType xmi:type="uml:Class" href="pathmap://MDD_LIBRARIES/mdd_types.uml#Boolean"/>
</mdd_extensions:BasicValue>
<mdd_extensions:Debuggable xmi:id="_9" source="userprofile.tuml" base_Element="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.1"/>
<mdd_extensions:Debuggable xmi:id="_10" source="userprofile.tuml" base_Element="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.0"/>
<mdd_extensions:Debuggable xmi:id="_11" source="userprofile.tuml" base_Element="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.1"/>
<mdd_extensions:Debuggable xmi:id="_12" source="userprofile.tuml" base_Element="Profile-_ownedBehavior.0-body-_node.0-_node.0-_node.0"/>
</xmi:XMI>
4 changes: 4 additions & 0 deletions releng/com.abstratt.kirra.server.product/kirra.product
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
-Dcloudfier.api.internalBaseUri=http://localhost:8081/services/
-Dcloudfier.api.externalBaseUri=http://localhost/services/
-Dcloudfier.database.username=cloudfier
-Dnodestore.file.base=nodestore/
-Dblobstore.file.base=blobstore/
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
Expand Down Expand Up @@ -75,6 +77,8 @@
<plugin id="com.abstratt.mdd.target.jee"/>
<plugin id="com.abstratt.mdd.target.jse"/>
<plugin id="com.abstratt.mdd.target.mean"/>
<plugin id="com.abstratt.blobstore"/>
<plugin id="com.abstratt.simpleblobstore"/>
<plugin id="com.abstratt.nodestore"/>
<plugin id="com.abstratt.nodestore.inmemory"/>
<plugin id="com.abstratt.nodestore.jdbc"/>
Expand Down
1 change: 1 addition & 0 deletions runtime/com.abstratt.blobstore/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
11 changes: 11 additions & 0 deletions runtime/com.abstratt.blobstore/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Blob Store
Bundle-SymbolicName: com.abstratt.blobstore;singleton:=true
Bundle-Version: 2.2.201606.qualifier
Bundle-Vendor: ABSTRATT
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.abstratt.blobstore
Require-Bundle: com.abstratt.pluginutils,
org.eclipse.equinox.registry,
org.eclipse.core.runtime;visibility:=reexport
5 changes: 5 additions & 0 deletions runtime/com.abstratt.blobstore/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml
4 changes: 4 additions & 0 deletions runtime/com.abstratt.blobstore/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
</plugin>
15 changes: 15 additions & 0 deletions runtime/com.abstratt.blobstore/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.abstratt.nodestore</groupId>
<artifactId>com.abstratt.nodestore</artifactId>
<version>2.2.201606-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<parent>
<artifactId>runtime</artifactId>
<groupId>com.abstratt.mdd.kirra</groupId>
<version>2.2.201606-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
</project>
109 changes: 109 additions & 0 deletions runtime/com.abstratt.blobstore/schema/factories.exsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.abstratt.nodestore" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="com.abstratt.nodestore" id="factories" name="Node Store Factories"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>

<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence>
<element ref="factory"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>

</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>

</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>

</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>

<element name="factory">
<complexType>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>

</documentation>
</annotation>
</attribute>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>

</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":com.abstratt.nodestore.INodeStoreFactory"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>

<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>

<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>

<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>

<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>


</schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.abstratt.blobstore;

public class BlobMetadata {
private String token;
private String originalName;
private String contentType;
private long contentLength;
public BlobMetadata(String token, String originalName, String contentType, long contentLength) {
this.token = token;
this.originalName = originalName;
this.contentType = contentType;
this.contentLength = contentLength;
}
public BlobMetadata() {
}

public String getToken() {
return token;
}
public String getOriginalName() {
return originalName;
}
public String getContentType() {
return contentType;
}
public long getContentLength() {
return contentLength;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.abstratt.blobstore;

public class BlobStoreException extends RuntimeException {
private static final long serialVersionUID = 1L;
public BlobStoreException(String message) {
super(message);
}
public BlobStoreException(Exception e) {
super(e);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.abstratt.blobstore;

import java.io.InputStream;

public interface IBlobStore {
BlobMetadata addBlob(String originalName, String contentType) throws BlobStoreException;
InputStream getContents(String token) throws BlobStoreException;
BlobMetadata setContents(String token, InputStream contents) throws BlobStoreException;
BlobMetadata getMetadata(String token) throws BlobStoreException;
void deleteBlob(String token) throws BlobStoreException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.abstratt.blobstore;

public interface IBlobStoreCatalog {
IBlobStore getBlobStore(String namespace);
void zap();
}
Loading

0 comments on commit eee349d

Please sign in to comment.