Examples of DataStorage


Examples of org.apache.pig.backend.datastorage.DataStorage

        boolean[] multiquery = {true, false};
       
        for (boolean b : multiquery) {
            pc.getProperties().setProperty("opt.multiquery", "" + b);
                   
            DataStorage dfs = pc.getDfs();
            dfs.setActiveContainer(dfs.asContainer("/tmp"));
            Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
            Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
            Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
            Map<String, String> fileNameMap = new HashMap<String, String>();
           
View Full Code Here

Examples of org.apache.pig.backend.datastorage.DataStorage

    }

    private void checkStorePath(String orig, String expected, boolean isTmp) throws Exception {
        pc.getProperties().setProperty("opt.multiquery",""+true);

        DataStorage dfs = pc.getDfs();
        dfs.setActiveContainer(dfs.asContainer("/tmp"));
        Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
        Map<OperatorKey, LogicalOperator> logicalOpTable = new HashMap<OperatorKey, LogicalOperator>();
        Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>();
        Map<String, String> fileNameMap = new HashMap<String, String>();
       
View Full Code Here

Examples of org.apache.pig.backend.datastorage.DataStorage

        return openDFSFile(fileName, ConfigurationUtil.toProperties(conf));

    }

    public static InputStream openDFSFile(String fileName, Properties properties) throws IOException{
        DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
        return openDFSFile(elem);
    }
View Full Code Here

Examples of org.apache.pig.backend.datastorage.DataStorage

        return getSize(fileName, ConfigurationUtil.toProperties(conf));
    }
   
    public static long getSize(String fileName, Properties properties) throws IOException {
      DataStorage dds = new HDataStorage(properties);
        ElementDescriptor elem = dds.asElement(fileName);
      
        // recursively get all the files under this path
        ElementDescriptor[] allElems = getFileElementDescriptors(elem);
       
        long size = 0;
View Full Code Here

Examples of org.apache.pig.backend.datastorage.DataStorage

     * @return an array of Element descriptors for files present (found by traversing all levels of dirs)
     *  in the input element descriptor
     * @throws DataStorageException
     */
    private static ElementDescriptor[] getFileElementDescriptors(ElementDescriptor elem) throws DataStorageException {
        DataStorage store = elem.getDataStorage();
        ElementDescriptor[] elems = store.asCollection(elem.toString());
        // elems could have directories in it, if so
        // get the files out so that it contains only files
        List<ElementDescriptor> paths = new ArrayList<ElementDescriptor>();
        List<ElementDescriptor> filePaths = new ArrayList<ElementDescriptor>();
        for (int m = 0; m < elems.length; m++) {
            paths.add(elems[m]);
        }
        for (int j = 0; j < paths.size(); j++) {
            ElementDescriptor fullPath = store.asElement(store
                    .getActiveContainer(), paths.get(j));
            // Skip hadoop's private/meta files ...
            if (fullPath.systemElement()) {
                continue;
            }
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

            uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
            return;
         }

         // ensure this navigation is exist
         DataStorage service = uicomp.getApplicationComponent(DataStorage.class);
         if (service.getPageNavigation(navigation.getOwnerType(), navigation.getOwnerId()) == null)
         {
            uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
            return;
         }
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

            uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
            return;
         }

         // TODO ensure this navigation is exist
         DataStorage service = uicomp.getApplicationComponent(DataStorage.class);
         if (service.getPageNavigation(navigation.getOwnerType(), navigation.getOwnerId()) == null)
         {
            uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
            return;
         }

         // remove selected navigation
         if (uicomp.navigations == null || uicomp.navigations.size() < 1)
         {
            return;
         }
         uicomp.navigations.remove(navigation);

         // remove navigation from UIPortalApplication
         UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
         removeNavigationByID(uiPortalApp.getUserPortalConfig().getNavigations(), navigation);
         removeNavigationByID(uiPortalApp.getNavigations(), navigation);
        
        
         service.remove(navigation);
         event.getRequestContext().addUIComponentToUpdateByAjax(uicomp);

         //Update UserToolbarGroupPortlet
         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChild(UIWorkingWorkspace.class);
         uiWorkingWS.updatePortletsByName("UserToolbarGroupPortlet");
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

   {
      public void execute(Event<UISiteManagement> event) throws Exception
      {
         UISiteManagement uicomp = event.getSource();
         String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
         DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
         WebuiRequestContext context = event.getRequestContext();
         UIApplication uiApplication = context.getUIApplication();
        
         //Minh Hoang TO: User could edit navigation if he/she has edit permissions on PortalConfig. That is not
         //at all logical and should be modified after release 3.1 GA
         UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
         UserPortalConfig userPortalConfig = configService.getUserPortalConfig(portalName, context.getRemoteUser());
         if(userPortalConfig == null)
         {
            uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
               new String[]{portalName}));
            return;
         }
        
         UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
         if (!userACL.hasEditPermission(userPortalConfig.getPortalConfig()))
         {
            uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));;
            return;
         }
        
         PageNavigation edittedNavigation = dataService.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
        
        
         //Minh Hoang TO: For release 3.1, Edit Permission check would be rollback to former checks on PortalConfig
         /*
         if (edittedNavigation == null)
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

   }

   @SuppressWarnings("unchecked")
   public void loadPortalConfigs() throws Exception
   {
      DataStorage service = getApplicationComponent(DataStorage.class);

      Query<PortalConfig> query = new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
      LazyPageList<PortalConfig> temp = service.find(query, new Comparator<PortalConfig>()
      {
         public int compare(PortalConfig pconfig1, PortalConfig pconfig2)
         {
            return pconfig1.getName().toLowerCase().compareTo(pconfig2.getName().toLowerCase());
         }
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

         page.setModifiable(true);
         if (page.getChildren() == null)
            page.setChildren(new ArrayList<ModelObject>());

         // check page is exist
         DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
         Page existPage = dataService.getPage(page.getPageId());
         if (existPage != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
         }

         // save page to database
         dataService.create(page);
         pageSelector.setValue(page.getPageId());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.